MySQL新建存储过程出现:ERROR 1558 (HY000): Column count of mysql.proc is wrong. Expected 20, found 16. Create
2017-07-18 17:24
1021 查看
我在MySQL版本:Ver 14.14 Distrib 5.1.61上创建存储过程是没有问题的,但是在版本:Ver 14.12 Distrib 5.0.26上面创建存储过程的时候就出现了上面的错误。甚至使用
错误原因:
是由于你曾经升级过mysql,或用不同的MySQL版本进行备份迁移恢复。升级和迁移完后未使用mysql_upgrade升级数据结构造成的。
mysql.proc:
是MySQL的系统表,用来记录存储过程或函数的信息。使用
解决办法:
使用命令:
查找MySQL的安装目录找到mysql_upgrade :
mysql_upgrade在MySQL的安装目录的bin中。可以使用如下命令查找MySQL的安装目录:
1
/usr/local/mysql 是指:mysql的安装路径。
/usr/local/mysql/bin 是指:mysql的运行程序存放路径,其中就包括 mysql_upgrade。
/usr/local/mysql/data 是指:mysql数据库文件的存放路径。
注意事项:
使用
[1]Column count of mysql.proc is wrong. Expected 20, found 16
转载地址
show procedure status查看存储过程都会报上面的错误。
错误原因:
是由于你曾经升级过mysql,或用不同的MySQL版本进行备份迁移恢复。升级和迁移完后未使用mysql_upgrade升级数据结构造成的。
mysql.proc:
是MySQL的系统表,用来记录存储过程或函数的信息。使用
desc mysql.proc查看上面不同版本的MySQL的mysql.proc,果然出错的MySQL的mysql.proc只有16列。
解决办法:
使用命令:
mysql_upgrade -u[username] -p[password]就可以解决。
查找MySQL的安装目录找到mysql_upgrade :
mysql_upgrade在MySQL的安装目录的bin中。可以使用如下命令查找MySQL的安装目录:
ps -ef|grep -w mysql,我获取的结果如下:
/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --log-error=/usr/local/mysql/data/Tencent_IM.err --pid-file=/usr/local/mysql/data/Tencent_IM.pid --socket=/tmp/mysql.sock --port=33061
1
/usr/local/mysql 是指:mysql的安装路径。
/usr/local/mysql/bin 是指:mysql的运行程序存放路径,其中就包括 mysql_upgrade。
/usr/local/mysql/data 是指:mysql数据库文件的存放路径。
注意事项:
使用
mysql_upgrade对数据库的数据表结构等升级时,数据库引擎MyISAM 会做检查、修复的动作,InnoDB 执行 mysql_upgrade 没有作用。
参考文献
[1]Column count of mysql.proc is wrong. Expected 20, found 16转载地址
相关文章推荐
- MySQL新建存储过程出现:ERROR 1558 (HY000): Column count of mysql.proc is wrong. Expected 20, found 16. Create
- MySQL新建存储过程出现:ERROR 1558 (HY000): Column count of mysql.proc is wrong. Expected 20, found 16. Create
- 执行mysql添加权限语法,报错提示:ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 42, found 39. C
- 【转】【MySQL报错】ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 43, found 39.
- 【MySQL报错】ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 43, found 39.
- ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 43, found 42. Created with MySQL 5
- Error Number : 1547 Error Message: Column count of mysql.proc is wrong. Expected 20, found 16. The
- ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 43, found 42. Created with MySQL 5
- Column count of mysql.proc is wrong. Expected 20, found 16.解决方法
- Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50096, now running 50173.
- ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 43. Created with MySQL 5
- ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 43. Created with MySQL 5
- Column count of mysql.proc is wrong. Expected 20, found 16.解决方法
- column count of mysql.proc is wrong. expected 20,found 16. the table is probably corruptd.
- ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 43. Created with MySQL 5
- Column count of mysql.events_waits_current is wrong. Expected 19, found 16. Created with MySQL 5054
- mysql 1558 - Column count of mysql.proc is wrong 的解决
- System error:Column count of mysql.event is wrong.
- MYSQL存储过程出现Result consisted of more than one row 错误的解决方法
- mysql存储过程error-This function has none of DETERMINISTIC, NO SQL