同事说navicat查询数据库,报错:1548-Cannot load from mysql.proc. The table is probably corrupted
同事查了查资料,问我数据库是否升级,刚接手不久,不知道在我之前是否升过级,那就mysql_upgrade -uroot -p 修复升级
mysql_upgrade -uroot -p
[root@db2343 ~]# mysql_upgrade -uroot
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/my/base/mysql.sock'
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/my/base/mysql.sock'
。。。。。。。。。。。。。。。。。。。
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log 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.proxies_priv OK
。。。。。。。。。。。。。。。。。。。。
mysql.user OK
test.test OK
Running 'mysql_fix_privilege_tables'...
OK
当出现许多ok之后,基本上就修复完毕。告知同事,查询ok。
way 2
这个方法好像不生效哦?
1548-Cannot load from mysql.proc. The table is probably corrupted
原因是mysql.proc升级时有个字段没有升级成功。
在5.1中mysql.proc表的comment字段是varchar(64):
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
但在5.5中应该是text:
`comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, So,执行下面的语句,把这个字段修改为text,就彻底OK了:
ALTER TABLE `proc`
MODIFY COLUMN `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL AFTER `sql_mode`;
网友评论