本地项目连接数据库mysqli::mysqli(): Server sent charset (255) unknown to the client

本地项目连接数据库mysqli::mysqli(): Server sent charset (255) unknown to the client

Ezra
2025-04-22 / 0 评论 / 2 阅读 / 正在检测是否收录...

本地php5.6项目在连接线上mysql8.0时报错mysqli::mysqli(): Server sent charset (255) unknown to the client
解决方法在数据库配置my.cnf里加入以下配置

[mysqld]
character-set-server=utf8
default_authentication_plugin=mysql_native_password
[mysql]
default-character-set=utf8
[client]
default-character-set=utf8
0

评论 (0)

取消