mysql5.7修改了root密碼也不能登陸的緣由

以下,我安裝的5.7中user表中用戶的plugin字段的值爲空,致使包括root用戶在內的賬號都沒法正常登陸,即便修改密碼也不行。改正方法下邊也有所說起。mysql

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:sql

修改方法:
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 manualthis

運行了mysql_upgrade。 plugin字段依舊爲空。坑rest

所以作了第一步後,登陸進去。而後執行:update user set plugin='mysql_native_password';orm

使全部用戶的plugin字段不爲空便可,若是要改密碼則按網上常見的方法:server

update mysql.user set authentication_string=password('weer') where User='root' and Host = 'localhost';ip

最後正常啓動mysql便可登陸string

相關文章
相關標籤/搜索