column count of mysql.proc is wrong. expected 20,found 16. the table is probably corruptd.

1558 1547 column count of mysql.proc is wrong. expected 20,found 16. the table is probably corruptd.
在用navicat连接时发生了一个错误
1558 column count of mysql.proc is wrong.Expected20,found 16.created with mysql 50091,now running 50528.please use mysql_upgrade to fix this error。

其实这个错误如果不是用客户端工具的话是发现不了的,因为我远程控制时操作是没有这个问题的。
查了下说是这个是由于升级后未使用mysql_upgrade升级数据结构或用不同版本进行备份迁移恢复造成的。
用Navicat for mysql会有此错误提示:

解决方法:
最后是通过"mysql_upgrade -uroot -p"

命令解决的。
直接用cmd命令执行这个,然后输入密码就好了。会自动升级mysql里的数据结构。

如:

mysql_upgrade -u root -pjoy

mysql_upgrade -u root -pjoy --datadir=/var/lib/mysql/ --basedir=/usr/

原文地址:https://www.cnblogs.com/jifeng/p/3556773.html