MySQL ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 42. Created with M

1.产生原因

在卸载原有的mysql5.5之后,安装了mysql5.7,进入数据库后,我发现原有的数据库都还在,但是在创建用户的时候报错

ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 42. Created with MySQL 50560, now running 50729. Please use mysql_upgrade to fix this error.

MySQL ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 42. Created with M

 原因:错误是由于你曾经升级过数据库,升级完后没有使用 mysql_upgrade升级数据结构造成的。

解决办法:更新数据库

 mysql_upgrade -uroot -p

 MySQL ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 42. Created with M

 

 然后进入数据库,执行语句

这次没有报错

MySQL ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 42. Created with M

参考链接:

https://blog.csdn.net/m18994118189/article/details/83068242

上一篇:windows10下anaconda安装、tensorflow安装以及pythonchar配置的使用


下一篇:apt update ,apt upgrade 和 apt dist-upgrade 的区别