skip to Main Content

If you try to connect with PHP PDO to the newest Version of mariadb (11.3.2) you will see this error and the client will be unable to connect:

SQLSTATE[HY000] [2054] Server sent charset (0) unknown to the client. Please, report to the developers

2

Answers


  1. Chosen as BEST ANSWER

    Reason: Mariadb sends a value that was unset before. While this is perfectly inline with the protocol since 2004, the mysql driver of php still implements a status of the protocol of this value as before of 2004, and thus will crash.

    You need to unset collation-server and character-set-server or set it to a compatible value in the server config until this is fixed.

    MariaDB Docker Image: Just add

    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

    More Info: https://github.com/php/php-src/issues/13452


  2. minor adjustment to @Alpix’s command above:

    command: mariadbd --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search