mysql数据库设置远程连接权限,执行grant all privileges on *.* to 'root'@'%' identified by '密码' with grant optio报错

mysql数据库设置远程连接权限,执行grant all privileges on *.* to 'root'@'%' identified by '密码' with grant optio报错

mysql数据库设置远程连接权限,执行grant all privileges on *.* to 'root'@'%' identified by '密码' with grant optio报错_第1张图片

ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 43, found 42. Created with MySQL 50556, now running 50639. Please use mysql_upgrade to fix this error.

解决办法: 
使用命令:mysql_upgrade -u[username] -p[password]就可以解决。

使用mysql_upgrade 对数据库的数据表结构等升级时,数据库引擎MyISAM 会做检查、修复的动作,InnoDB 执行 mysql_upgrade 没有作用。

查找MySQL的安装目录找到mysql_upgrade : 

  1. whereis  mysql_upgrade
  2. cd /usr/bin/
  3.  ./mysql_upgrade -uroot -p123 (123为密码)

mysql数据库设置远程连接权限,执行grant all privileges on *.* to 'root'@'%' identified by '密码' with grant optio报错_第2张图片

然后进入到mysql再执行权限修改即可:grant all privileges on *.* to 'root'@'%' identified by 'root4xml004a' with grant option;

如:

mysql数据库设置远程连接权限,执行grant all privileges on *.* to 'root'@'%' identified by '密码' with grant optio报错_第3张图片























你可能感兴趣的:(mysql)