mysql5.7ip 无法登陆_mysql5.7修改了root密码也不能登录的原因

如下,我安装的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即可登录

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值