Bug #74461 [Com]: mysqlnd error on utf8mb4 charset used by MySQL 8.0
| From: | bill at karwin dot com | Date: | Mon, 17 Apr 2017 16:23:12 +0000 |
| Subject: | Bug #74461 [Com]: mysqlnd error on utf8mb4 charset used by MySQL 8.0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208622@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
Comment by: bill at karwin dot com
Reported by: bill at karwin dot com
Summary: mysqlnd error on utf8mb4 charset used by MySQL 8.0
Status: Open
Type: Bug
Package: MySQLi related
PHP Version: 7.1.4
Block user comment: N
Private report: N
New Comment:
See also:
https://bugs.mysql.com/bug.php?id=85946
https://github.com/rails/rails/issues/28730
Previous Comments:
------------------------------------------------------------------------
[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