Skip to content

Unable to connect to MariaDB 11.3 #13452

Description

@mvorisek

Description

Docker GH service:

    services:
      mysql:
        image: mysql:8
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass_root -e MYSQL_USER=atk4_test_user -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test
      mariadb:
        image: mariadb:11.2.3
        options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=atk4_pass_root -e MYSQL_USER=atk4_test_user -e MYSQL_PASSWORD=atk4_pass -e MYSQL_DATABASE=atk4_test
php -r '(new PDO("mysql:host=mysql", "root", "atk4_pass_root"))->exec("ALTER USER '"'"'atk4_test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 5");'

passes, but with MariaDB:

php -r '(new PDO("mysql:host=mariadb", "root", "atk4_pass_root"))->exec("ALTER USER '"'"'atk4_test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 5");

it fails with the following error:

PDOException: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers in Command line code:1
Stack trace:
#0 Command line code(1): PDO->__construct('mysql:host=mari...', 'root', 'atk4_pass_root')
#1 {main}
  thrown in Command line code on line 1

With MariaDB 11.2, the PHP is working perfectly.

I am not sure if this is MariaDB or PHP error, but I would expect at least a better error message.

full repro: #13452 (comment)

PHP Version

any

Operating System

any

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions