Tuesday, July 24, 2018

mysql_connect(): server sent charset unknown to the client


Once after migrate to MYSQL 8.0 , When I tried to access the MYSQL server from PHP . I got the following warning message and also I didn't get any response from MYSQL.

mysql_connect(): server sent charset unknown to the client

I found the solution from this link  https://stackoverflow.com/questions/43437490/pdo-construct-server-sent-charset-255-unknown-to-the-client-please-rep


https://stackoverflow.com/questions/43437490/pdo-construct-server-sent-charset-255-unknown-to-the-client-please-rep
Following settings helped me to resolve this issue. I have add the following setting in MYSQL configuration file “my.cnf” file and restart a MYSQL .
 [client]
default-character-set=utf8

[mysql]
default-character-set=utf8

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