美文网首页
关于php7.3.10连接mysql8出现The server

关于php7.3.10连接mysql8出现The server

作者: 拾杉 | 来源:发表于2020-10-18 15:58 被阅读0次

出现的问题:
新建帐户read,在phpadmin无法登录
但使用root用户可以正常登录

image.png
我的php也受到了影响 image.png
最后得出的结论是:
由于我的php7.3.10不支持caching_sha2_password
图中没有看到caching_sha2_password image.png

而mysql8.0.17的密码验证方式是caching_sha2_password

image.png

所以,只能去修改配置文件了。。。C:\AppServ\MySQL\mysql.ini
添加default_authentication_plugin=mysql_native_password

image.png
然后重启mysql
image.png
最后修改read帐户的登录验证方式
ALTER USER 'read'@'%' identified with mysql_native_password BY '87654321'; image.png

正常登录!


image.png

总结:
后面需要新建帐户的时候,要加上mysql_native_password 来指定验证方式
create user 'root'@'localhost' identified with mysql_native_password by '12345678';

相关文章

网友评论

      本文标题:关于php7.3.10连接mysql8出现The server

      本文链接:https://www.haomeiwen.com/subject/qmdcmktx.html