Bug 1646158 - PHP Warning: mysqli::mysqli(): Server sent charset (255) unknown to the client.
Summary: PHP Warning: mysqli::mysqli(): Server sent charset (255) unknown to the client.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: php
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Web Stack Team
QA Contact: RHEL Stacks Subsystem QE
Lenka Špačková
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-05 09:38 UTC by Karel Volný
Modified: 2020-06-17 11:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
.The `php-mysqlnd` database connector does not work with MySQL 8.0 The default character set has been changed to `utf8mb4` in MySQL 8.0 but this character set is unsupported by the `php-mysqlnd` database connector. Consequently, `php-mysqlnd` fails to connect in the default configuration. To work around this problem, specify a known character set as a parameter of the MySQL server configuration. For example, modify the `/etc/opt/rh/rh-mysql80/my.cnf.d/mysql-server.cnf` file to read: ---- [mysqld] character-set-server=utf8 ----
Clone Of:
Environment:
Last Closed: 2020-06-17 11:05:47 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
PHP Bug Tracker 74461 None None None 2018-11-05 09:38:42 UTC
Red Hat Bugzilla 1584253 unspecified CLOSED RFE: add collection for MySQL 8.0 2020-10-14 00:28:05 UTC

Internal Links: 1584253

Description Karel Volný 2018-11-05 09:38:42 UTC
Description of problem:
PHP mysql fails to connect to MySQL 8 in default configuration due to change of default charset to utf8mb4.

Version-Release number of selected component (if applicable):
php-mysqlnd-5.4.16-46.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. install rh-mysql80 collection and stock php-mysqlnd
2. start mysql server
3. try to connect to mysql from php via mysqli functions

Actual results:
PHP Warning:  mysqli::mysqli(): Server sent charset (255) unknown to the client. Please, report to the developers in /mnt/tests/CoreOS/mysql/Security/CVE-2010-1848-mysql-multiple-insufficient-table-name-checks/CVE-2010-1848-mysqli.php on line 11
PHP Warning:  mysqli::mysqli(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers in /mnt/tests/CoreOS/mysql/Security/CVE-2010-1848-mysql-multiple-insufficient-table-name-checks/CVE-2010-1848-mysqli.php on line 11
Failed to connect to DB: Server sent charset unknown to the client. Please, report to the developers

Expected results:
(no such problem)

Additional info:
see https://bugs.php.net/bug.php?id=74461

Comment 3 Remi Collet 2019-05-29 09:22:48 UTC
doc text looks good to me, as this a the simple way.

BTW, charset can also be set from PHP using "mysqli_set_charset" function.

Comment 5 Joe Orton 2020-06-17 11:05:47 UTC
This issue is resolved in PHP 7.x in RHEL8.


Note You need to log in before you can comment on or make changes to this bug.