Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-32975

Default charset doesn't work with PHP MySQLi extension

Details

    Description

      Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error 'Server sent charset (0) unknown to the client'.

      I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
      collation-server = utf8mb4_general_ci (11.2.2)
      to
      character-set-collations = utf8mb4=uca1400_ai_ci (11.3.1)

      If I change this back, connections from PHP work again.

      This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

      Steps to reproduce:

      • Install PHP 8.3, including MySQLi extension.
      • Install MariaDB 11.3.1, CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';.
      • Test a PHP page, e.g.

                                                                                            
        <?php
        error_reporting(E_ALL);
        ini_set('display_errors', 'on');
        $conn = new mysqli("localhost", "username", "password");
        if ($conn->connect_error) {
          die("Connection failed: " . $conn->connect_error);
        }
        echo "Connected successfully";
        ?>
        

      • Observe error:

        Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/html/index.php:4 Stack trace: #0 /var/www/html/index.php(4): mysqli->__construct() #1 {main} thrown in /var/www/html/index.php on line 4
        

      Attachments

        Issue Links

          Activity

            Quppa David Warner created issue -
            Quppa David Warner made changes -
            Field Original Value New Value
            Description Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1.
            - Test a PHP page, e.g.
              GNU nano 6.2 index.php
            {{<?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>}}
            Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1.
            - Test a PHP page, e.g.
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>
            Quppa David Warner made changes -
            Description Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1.
            - Test a PHP page, e.g.
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>
            Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1.
            - Test a PHP page, e.g.
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>

            {{Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/html/index.php:4 Stack trace: #0 /var/www/html/index.php(4): mysqli->__construct() #1 {main} thrown in /var/www/html/index.php on line 4}}
            Quppa David Warner made changes -
            Description Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1.
            - Test a PHP page, e.g.
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>

            {{Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/html/index.php:4 Stack trace: #0 /var/www/html/index.php(4): mysqli->__construct() #1 {main} thrown in /var/www/html/index.php on line 4}}
            Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1.
            - Test a PHP page, e.g.
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>

            - Observe error:
            Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/html/index.php:4 Stack trace: #0 /var/www/html/index.php(4): mysqli->__construct() #1 {main} thrown in /var/www/html/index.php on line 4
            Quppa David Warner made changes -
            Description Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1.
            - Test a PHP page, e.g.
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>

            - Observe error:
            Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/html/index.php:4 Stack trace: #0 /var/www/html/index.php(4): mysqli->__construct() #1 {main} thrown in /var/www/html/index.php on line 4
            Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1, {{CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';}}.
            - Test a PHP page, e.g.
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>

            - Observe error:
            Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/html/index.php:4 Stack trace: #0 /var/www/html/index.php(4): mysqli->__construct() #1 {main} thrown in /var/www/html/index.php on line 4
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            Assignee Alice Sherepa [ alice ]
            alice Alice Sherepa made changes -
            Assignee Alice Sherepa [ alice ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Description Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1, {{CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';}}.
            - Test a PHP page, e.g.
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>

            - Observe error:
            Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/html/index.php:4 Stack trace: #0 /var/www/html/index.php(4): mysqli->__construct() #1 {main} thrown in /var/www/html/index.php on line 4
            Some charset change in MariaDB 11.3.1 appears to break PHP clients, raising the error '{{Server sent charset (0) unknown to the client}}'.

            I noticed /etc/mysql/mariadb.conf.d/50-server.cnf changed
            {{collation-server = utf8mb4_general_ci}} (11.2.2)
            to
            {{character-set-collations = utf8mb4=uca1400_ai_ci}} (11.3.1)

            If I change this back, connections from PHP work again.

            This Plesk user seems to have encountered the same issue: https://talk.plesk.com/threads/500-plesk-exception-database-db-query-failed-sqlstate-hy000-2054-server-sent-charset-0-unknown-to-the-client.372563/

            Steps to reproduce:
            - Install PHP 8.3, including MySQLi extension.
            - Install MariaDB 11.3.1, {{CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';}}.
            - Test a PHP page, e.g.
            {code:php}
            <?php
            error_reporting(E_ALL);
            ini_set('display_errors', 'on');
            $conn = new mysqli("localhost", "username", "password");
            if ($conn->connect_error) {
              die("Connection failed: " . $conn->connect_error);
            }
            echo "Connected successfully";
            ?>
            {code}
            - Observe error:
            {noformat}
            Fatal error: Uncaught mysqli_sql_exception: Server sent charset (0) unknown to the client. Please, report to the developers in /var/www/html/index.php:4 Stack trace: #0 /var/www/html/index.php(4): mysqli->__construct() #1 {main} thrown in /var/www/html/index.php on line 4
            {noformat}
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Alexander Barkov [ bar ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.1 [ 28549 ]
            Fix Version/s 11.2 [ 28603 ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            danblack Daniel Black made changes -
            serg Sergei Golubchik made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            bar Alexander Barkov made changes -
            Fix Version/s 10.4 [ 22408 ]
            bar Alexander Barkov made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            bar Alexander Barkov made changes -
            Assignee Alexander Barkov [ bar ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Priority Critical [ 2 ] Blocker [ 1 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            danblack Daniel Black made changes -
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Alexander Barkov [ bar ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            bar Alexander Barkov made changes -
            Fix Version/s 10.4.34 [ 29625 ]
            Fix Version/s 10.5.25 [ 29626 ]
            Fix Version/s 10.6.18 [ 29627 ]
            Fix Version/s 10.11.8 [ 29630 ]
            Fix Version/s 11.0.6 [ 29628 ]
            Fix Version/s 11.1.5 [ 29629 ]
            Fix Version/s 11.2.4 [ 29631 ]
            Fix Version/s 11.4.2 [ 29633 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.1 [ 28549 ]
            Fix Version/s 11.2 [ 28603 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            People

              bar Alexander Barkov
              Quppa David Warner
              Votes:
              3 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.