您的位置:首页 > 数据库 > MySQL

Column count of mysql.proc is wrong. Expected 20, found 16.解决方法

2016-03-21 10:41 627 查看
Column count of mysql.proc is wrong. Expected 20, found 16.解决方法
分类: linux系统 数据库知识 2011-10-19 17:15 1090人阅读 评论(0) 收藏 举报
1558 - Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50018, now running 50146. Please use mysql_upgrade to fix this error.

今天58lianmeng服务器上出现了这个不起眼的错误。 其实这个错误如果用phpmyadmin的话发现不了、
错误来源,是由于你曾经升级过数据库
升级完后未使用mysql_upgrade升级数据结构造成的。
用Navicat For MySQL会有此错误提示。
记录一下解决方法。 mysql.proc
这个是5.1里面的系统表来的,用来记录存储过程或函数的信息. 你的数据库肯定作过升级或用不同的版本进行备份迁移恢复. 解决办法:
使用命令:mysql_upgrade 就可以解决 mysql_upgrade -u root -p123456 --datadir=D:\Database --basedir=D:\Mysql
MySQL utility for upgrading databases to new MySQL versions.
问题 重新开机后, 查看当机前发生的事情, 都是出现下述讯息:
$ sudo less /var/log/syslog
Oct 8 20:15:13 example kernel: [5695418.376686] type=1505 audit(1286540113.390:48176): operation="profile_replace" pid=26753 name="/usr/sbin/mysqld"
Oct 8 20:15:13 example /etc/mysql/debian-start[26767]: Upgrading MySQL tables if necessary.
Oct 8 20:15:13 example /etc/mysql/debian-start[26770]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Oct 8 20:15:13 example /etc/mysql/debian-start[26770]: Looking for 'mysql' as: /usr/bin/mysql
Oct 8 20:15:13 example /etc/mysql/debian-start[26770]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Oct 8 20:15:13 example /etc/mysql/debian-start[26770]: This installation of MySQL is already upgraded to 5.1.41 , use --force if you still need to run mysql_upgrade
Oct 8 20:15:13 example /etc/mysql/debian-start[26777]: Checking for insecure root accounts.
Oct 8 20:15:13 example /etc/mysql/debian-start[26781]: Triggering myisam-recover for all MyISAM tables
Oct 8 20:15:39 example init: mysql main process (26757) killed by KILL signal
解法
看来像是 MyISAM 的 Table 出问题, 但是, 检查起来都没任何异常, 先假设是升级 MySQL 造成的问题, 所以手动执行 mysql_upgrade 来完成升级动作. 注: 下述指令于 MySQL upgrade 后, 都可以手动执行. (InnoDB 执行 mysql_upgrade 没有作用, MyISAM 会做检查、修复的动作)
$ sudo mysql_upgrade -u root -p # 若出现下述讯息, 则加上 --force
This installation of MySQL is already upgraded to 5.1.49, use --force if you still need to run mysql_upgrade
$ sudo mysql_upgrade --force -u root -p
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
Running 'mysql_fix_privilege_tables'...
OK
$ sudo /etc/init.d/mysql restart # 重新启动 MySQL
暂时做个纪录, 希望别再发生问题.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: