如果您try 使用PHP PDO连接到最新版本的MariaDB(11.3.2),您将看到此错误,并且客户端将无法连接:
SQLSTATE[HY000] [2054] Server sent charset (0) unknown to the client. Please, report to the developers
个
如果您try 使用PHP PDO连接到最新版本的MariaDB(11.3.2),您将看到此错误,并且客户端将无法连接:
SQLSTATE[HY000] [2054] Server sent charset (0) unknown to the client. Please, report to the developers
个
原因:MariaDB发送一个以前未设置的值.虽然这与2004年以来的协议完全一致,但php的MySQL驱动程序仍然像2004年之前一样实现了此值的协议状态,因此将崩溃.
您需要取消设置COLLATION-SERVER和CHARACTER-SET-SERVER,或者在服务器配置中将其设置为兼容值,直到修复它为止.
MariaDB Docker镜像: 只需添加
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
Normal Install:
Just remove the line character-set-collations = utf8mb4=uca1400_ai_ci from /etc/mysql/mariadb.conf.d/50-server.cnf