今天看到mysql的错误日志里,有这样的错误:
[ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50051, now running 50140.
Please use mysql_upgrade to fix this error.
该问题,应该是因为在mysql5.1的版本中使用了mysql5.0的库。
这个错误信息中,已经告诉我们让我们利用mysql_upgrade 去修复这个问题。
下面是我修复使用的命令:
/usr/local/mysql_51/bin/mysql_upgrade --datadir=/home/mysql_51/ --socket=/tmp/mysql88.sock
修复过程中显示如下信息:
[ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50051, now running 50140.
Please use mysql_upgrade to fix this error.
该问题,应该是因为在mysql5.1的版本中使用了mysql5.0的库。
这个错误信息中,已经告诉我们让我们利用mysql_upgrade 去修复这个问题。
下面是我修复使用的命令:
/usr/local/mysql_51/bin/mysql_upgrade --datadir=/home/mysql_51/ --socket=/tmp/mysql88.sock
修复过程中显示如下信息:
0
Running 'mysqlcheck' with connection arguments: '--port=3311' '--socket=/tmp/mysql.sock' '--socket=/tmp/mysql88.sock'
Running 'mysqlcheck' with connection arguments: '--port=3311' '--socket=/tmp/mysql.sock' '--socket=/tmp/mysql88.sock'
censor.cdb_attachments OK
censor.cdb_censorposts OK
censor.cdb_postinfos OK
censor.cdb_postinfos_tmp OK
censor.cdb_posts OK
censor.cdb_posts_tmp OK
censor.st_login OK
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
error : Table upgrade required. Please do "REPAIR TABLE `help_category`" or dump/reload to fix it!
mysql.help_keyword
error : Table upgrade required. Please do "REPAIR TABLE `help_keyword`" or dump/reload to fix it!
mysql.help_relation OK
mysql.help_topic
error : Table upgrade required. Please do "REPAIR TABLE `help_topic`" or dump/reload to fix it!
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc
error : Table upgrade required. Please do "REPAIR TABLE `proc`" or dump/reload to fix it!
mysql.procs_priv OK
mysql.servers OK
mysql.slow_log
Error : You can't use locks with log tables.
status : OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name
error : Table upgrade required. Please do "REPAIR TABLE `time_zone_name`" or dump/reload to fix it!
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Repairing tables
mysql.help_category OK
mysql.help_keyword OK
mysql.help_topic OK
mysql.proc OK
mysql.time_zone_name OK
Running 'mysql_fix_privilege_tables'...
ok
Running 'mysqlcheck' with connection arguments: '--port=3311' '--socket=/tmp/mysql.sock' '--socket=/tmp/mysql88.sock'
censor.cdb_attachments OK
censor.cdb_censorposts OK
censor.cdb_postinfos OK
censor.cdb_postinfos_tmp OK
censor.cdb_posts OK
censor.cdb_posts_tmp OK
censor.st_login OK
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
error : Table upgrade required. Please do "REPAIR TABLE `help_category`" or dump/reload to fix it!
mysql.help_keyword
error : Table upgrade required. Please do "REPAIR TABLE `help_keyword`" or dump/reload to fix it!
mysql.help_relation OK
mysql.help_topic
error : Table upgrade required. Please do "REPAIR TABLE `help_topic`" or dump/reload to fix it!
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc
error : Table upgrade required. Please do "REPAIR TABLE `proc`" or dump/reload to fix it!
mysql.procs_priv OK
mysql.servers OK
mysql.slow_log
Error : You can't use locks with log tables.
status : OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name
error : Table upgrade required. Please do "REPAIR TABLE `time_zone_name`" or dump/reload to fix it!
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Repairing tables
mysql.help_category OK
mysql.help_keyword OK
mysql.help_topic OK
mysql.proc OK
mysql.time_zone_name OK
Running 'mysql_fix_privilege_tables'...
ok
0
但是,在修复过程中也出现了几个问题,看提示,只要我们再次修复相关表即可。
REPAIR TABLE `help_category`;
REPAIR TABLE `help_keyword ‘ ;
REPAIR TABLE `help_topic`;
REPAIR TABLE `proc`;
REPAIR TABLE `time_zone_name`;
再次重启mysql 在错误日志中就不再显示相关报错了。
REPAIR TABLE `help_category`;
REPAIR TABLE `help_keyword ‘ ;
REPAIR TABLE `help_topic`;
REPAIR TABLE `proc`;
REPAIR TABLE `time_zone_name`;
再次重启mysql 在错误日志中就不再显示相关报错了。
编辑回复