Bug #74461 [Opn->Fbk]: mysqlnd error on utf8mb4 charset used by MySQL 8.0

From: Date: Wed, 02 May 2018 12:13:57 +0000
Subject: Bug #74461 [Opn->Fbk]: mysqlnd error on utf8mb4 charset used by MySQL 8.0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215015@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74461&edit=1 ID: 74461 Updated by: requinix@php.net Reported by: bill at karwin dot com Summary: mysqlnd error on utf8mb4 charset used by MySQL 8.0 -Status: Open +Status: Feedback Type: Bug Package: MySQLi related PHP Version: 7.1.4 Block user comment: N Private report: N New Comment: Should be fixed as of 7.0.19, 7.1.5, and 7.2.0. Anyone confirm? Previous Comments: ------------------------------------------------------------------------ [2018-05-02 12:11:24] macleo at outlook dot com https://github.com/php/php-src/commit/35a28fac51e4b210f8f3f51b754786908a977462#diff-ff4e2dc4962dc25a1512353299992c8d ------------------------------------------------------------------------ [2017-04-17 16:36:38] nikic@php.net https://github.com/php/php-src/commit/35a28fac51e4b210f8f3f51b754786908a977462 So probably this is already fixed. ------------------------------------------------------------------------ [2017-04-17 16:23:10] bill at karwin dot com See also: https://bugs.mysql.com/bug.php?id=85946 https://github.com/rails/rails/issues/28730 ------------------------------------------------------------------------ [2017-04-17 16:19:52] bill at karwin dot com Description: ------------ PHP 7.1 fails to connect to MySQL 8.0.x because of charset incompatibility with MySQL 8.0's new default server charset of utf8mb4. The workaround is to change the server charset back to pre-MySQL 8.0 default of utf8. Test script: --------------- $mysqli = new mysqli('127.0.0.1', 'root', 'xxxx', 'test'); $pdo = new PDO('mysql:host=127.0.0.1;dbname=test', 'root', 'xxxx'); Expected result: ---------------- There should be no error. Actual result: -------------- Error when using mysqli: PHP Warning: mysqli::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers in ... on line 3 Error when using PDO_MYSQL: Connection failed: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74461&edit=1

« previous php.bugs (#215015) next »