Linux Apps Tutorials - Herong's Tutorial Examples - v1.00, by Herong Yang
"Server sent charset unknown to the client" Error
This section provides a tutorial example on how to resolve the 'Server sent charset unknown to the client' error received in PHP mysqli_connect() call to MySQL 8.0 running on CentOS 8 systems.
If you are running an older version of PHP on a client computer and tries to connection a MySQL 8.0 running on a CentOS system with the mysqli_connect() function, you will get the "Server sent charset unknown to the client" error:
herong$ php --version PHP 5.6.30 (cli) (built: Oct 10 2017 20:30:32) herong$ php test.php PHP Warning: mysqli_connect(): Server sent charset (255) unknown to the client. Please, report to the developers in /Users/herong/test.php on line 10. PHP Warning: mysqli_connect(): (HY000/2054): Server sent charset ...
Based on reports on the Internet, the above issue is caused by the default setting of "character_set_client = utf8mb4", which is unknown to older PHP "mysqli" modules.ß
I have tried a number of solutions suggested on the Internet. None of them works for me. Combinations of them are also not working.
The only solution that worked for my is to upgrade PHP to
herong$ php --version PHP 7.2.11 (cli) (built: Oct 9 2018 15:09:36) ( NTS ) herong$ php test.php mysqli_get_server_info() = 8.0.17 mysqli_get_host_info() = 192.168.1.100 via TCP/IP
Table of Contents