如下,我安装的5.7中user表中用户的plugin字段的值为空,导致包括root用户在内的帐号都无法正常登录,即使修改密码也不行。改正方法下边也有所提及。
2016-11-07T02:03:11.759300Z 0 [Warning] User entry 'root'@'localhost' has an empty plugin value. The user will be ignored and no one can login with this user anymore.
2016-11-07T02:03:11.759332Z 0 [Warning] User entry 'root'@'luyunstaff007-b85m-hd3' has an empty plugin value. The user will be ignored and no one can login with this user anymore.
2016-11-07T02:03:11.759349Z 0 [Warning] User entry 'root'@'127.0.0.1' has an empty plugin value. The user will be ignored and no one can login with this user anymore.
2016-11-07T02:03:11.759364Z 0 [Warning] User entry 'root'@'::1' has an empty plugin value. The user will be ignored and no one can login with this user anymore.
2016-11-07T02:03:11.759415Z 0 [Warning] User entry 'root'@'%' has an empty plugin value. The user will be ignored and no one can login with this user anymore.
2016-11-07T02:03:11.759431Z 0 [Warning] Some of the user accounts with SUPER privileges were disabled because of empty mysql.user.plugin value. If you are upgrading from MySQL 5.6 to MySQL 5.7 it means we were not able to substitute for empty plugin column. Probably because of pre 4.1 password hash. If your account is disabled you will need to:
修改方法:
2016-11-07T02:03:11.759470Z 0 [Warning] 1. Stop the server and restart it with --skip-grant-tables.
2016-11-07T02:03:11.759495Z 0 [Warning] 2. Run mysql_upgrade.
2016-11-07T02:03:11.759515Z 0 [Warning] 3. Restart the server with the parameters you normally use.
2016-11-07T02:03:11.759536Z 0 [Warning] For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual
运行了mysql_upgrade。 plugin字段依旧为空。坑
因此做了第一步后,登录进去。然后执行:update user set plugin='mysql_native_password';
使所有用户的plugin字段不为空即可,如果要改密码则按网上常见的方法:
update mysql.user set authentication_string=password('weer') where User='root' and Host = 'localhost';
最后正常启动mysql即可登录