MYSQL8.0安装后 phpMyAdmin无法登陆解决

因为某些原因安装了8.0以后phpMyAdmin始终无法登陆 。

我也是手残,没事更新什么mysql。

原因在于MYSQL8.0的密码验证方式从mysql_native_password改为了caching_sha2_password。而目前为止,php的pdo和mysqli应该还是不支持的。

所以在my.ini找到

default_authentication_plugin=caching_sha2_password

改为

default_authentication_plugin=mysql_native_password

重启,发现还是不能登陆。推测应该是因为密码已经是sha2方式保存的,所以php以原来的方式验证肯定无法通过,所以要修改一下密码。

如下:

 
  1. use mysql;

  2. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';

  3. FLUSH PRIVILEGES;

终于解决了

参考文献:

https://blog.csdn.net/qq_28347599/article/details/80331484

https://www.shiqidu.com/d/358

你可能感兴趣的:(MYSQL8.0安装后 phpMyAdmin无法登陆解决)