mysql v error 1045_MySQL8.0.21 root 密码登陆不入-ERROR 1045(28000) Access denied for user 'root'@'localho...

MMP,困扰5个小时的问题,终于在喝酒后解决。

MySQL5.7跨版本升级到MySQL8.0.21 最新版本。

通过免密钥登陆 --skip-grant-tables

update 修改完密码死活登陆不上。

ERROR 1045(28000) Access  denied for user [email protected] (using password YES)

1)./mysqld_safe  --defaults-file=/etc/my821.cnf       -skip-grant-tables   &

2) ./mysql

槽,将root密码清空成空格!!!!!!!!

mysql>update  mysql.user  set  authentication_string=‘  ‘ where user=‘root ‘;

3) flush privileges

4) 正常启动

/mysqld_safe  --defaults-file=/etc/my821.cnf  &

5)空密码登陆

./mysql  -uroot  -p空格

6) 在正常登陆情况下 ,alter user  ‘[email protected] identified  with  mysql_native_password by ‘MyQ_123‘ ;  flush  privileges  ;

7)再次登陆,  ./mysql -uroot  -pMyQ_123

原因是 :在MySQL 8.0中,caching_sha2_password是默认的身份验证插件,而不是mysql_native_password 。

select  host ,user  , authentication_string,plugin from mysql.user  where user=‘root‘  \G ;

原文:https://www.cnblogs.com/vzhangxk/p/13357892.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值