Warning: mysqli_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers in G:\software\php\PHPTutorial\WWW\laoliu\php_mysql\day1.php on line 5 数据库连接失败Server sent charset unknown to the client. Please, report to the developers
时间: 2023-10-08 22:12:57 浏览: 294
回答: 这个错误是由于服务器发送了一个客户端未知的字符集导致的。\[1\]解决这个问题的方法是在my.cnf文件中设置default_authentication_plugin为mysql_native_password,并使用ALTER USER命令将root用户的身份验证方式更改为mysql_native_password。\[2\]另外,还需要确保在连接数据库时使用正确的用户名、密码和服务器地址。\[3\]如果仍然无法解决问题,建议向开发人员报告此问题以获取进一步的帮助。
#### 引用[.reference_title]
- *1* [php报错SERVER SENT CHARSET (255) UNKNOWN](https://blog.csdn.net/weixin_45000199/article/details/110916987)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [docker 搭建LNMP环境](https://blog.csdn.net/interpolo/article/details/110769173)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文