mysql 1558 - Column count of mysql.proc is wrong 的解決
起因是原來mysql是5.0.47的,后來想用分區(qū)表,故整個(gè)庫導(dǎo)出,
然后倒入5.1.51的環(huán)境中,但是在創(chuàng)建存儲(chǔ)過程中出現(xiàn)如下錯(cuò)誤:
1558 - Column count of MySQL.proc is wrong. Expected 20, found 16
1 :保險(xiǎn)一點(diǎn)先dump或者冷備份:
mysqldump -uroot -p111111 --quick --master-data=1 --all-databases --flush-logs --lock-tables >
2解決辦法:
使用命令:mysql_upgrade就可以解決
mysql_upgrade -u root --datadir=/var/lib/mysql/ --basedir=/ --password=123456
下面是操作的過程:
[root@db lib]# mysql_upgrade -u root -p111111 -hdb --datadir=/var/lib/mysql/ --basedir=/
mysql_upgrade: the '--datadir' option is always ignored
mysql_upgrade: the '--basedir' option is always ignored
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--host=db'
Running 'mysqlcheck' with connection arguments: '--host=db'
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log
Error : You can't use locks with log tables.
status : OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers OK
mysql.slow_log
Error : You can't use locks with log tables.
status : OK
mysql.student OK
mysql.t1 OK
mysql.t2 OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
................................................
test.newuser OK
test.usertag OK
Running 'mysql_fix_privilege_tables'...
WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (latin1). Please verify if necessary.
WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (latin1_swedish_ci). Please verify if necessary.
WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.
OK
[root@db lib]#