cPanel Server sent charset unknown to the client. MYSQL 8 Error

I changed my site to a new Cpanel server with MySQL 8 but got an error message that said, “the server sent charset unknown to the client. Please, report to the developers”.

Why are you getting this message? The default character set in MySQL 8 has been changed to utfmb4, which is different from the character set used in the database.

workaround

1/ Updating your version of PHP to a newer version (more recent than 7.4) will typically solve this issue.
2/ Alternatively, you can modify the /etc/my.cnf file to set the default character set to UTF-8:
edit my.cnfSpecify the client code, and add the following content.


[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8

Restart mysql and the websites should load properly.

Leave a Comment

+ 29 = 33