php mysqli_connect:客户端未知的身份验证方法
P粉170858678
P粉170858678 2023-10-13 18:02:37
[MySQL讨论组]

我正在使用 php mysqli_connect 登录 MySQL 数据库(全部在本地主机上)

这是 mysql.user 表:

MySQL 服务器 ini 文件:

[mysqld]
# The default authentication plugin to be used when connecting to the server
default_authentication_plugin=caching_sha2_password
#default_authentication_plugin=mysql_native_password

在MySQL Server ini文件中使用caching_sha2_password,根本不可能用user1或user2登录;

错误:mysqli_connect():服务器请求客户端 [caching_sha2_password] 未知的身份验证方法...

在MySQL Server ini文件中使用mysql_native_password,可以用user1登录,但是用user2登录,同样的错误;


如何在 mySql 服务器上使用 caching_sha2_password 登录?

P粉170858678
P粉170858678

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号