MySQL: Server sent charset (255) unknown to the client.

The other day, I installed MySQL 8 on my Windows 7 machine.

However, it failed to work with my older phpMyAdmin installation, which had come packaged with the WampServer software stack that I downloaded back in 2012.

When I navigated to the login page for phpMyAdmin, I was met with the following error:

Server sent charset (255) unknown to the client.

This issue occurs because MySQL 8 changed its default charset to utfmb4. This is actually a good thing, as the utfmb4 character set supports a wider range of symbols and emojis.

Unfortunately, older clients do not support this charset and are unable to recognize it.

Because this was a test machine for personal use, I didn’t really want to upgrade the client.

A quick fix for me was to force MySQL 8 to use utf8 / utf8_unicode_ci instead of utfmb4.

To do this, I edited my my.ini configuration file, which was located in: C:\ProgramData\MySQL\MySQL Server 8.0

This .ini file could be in a different location on your server.

At the end of my.ini file, I placed the following lines:

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

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

Once I saved my changes, I restarted MySQL80 in Window’s Services section. Note that you will find the Services section in Administrative Tools.

I then refreshed phpMyAdmin and, boom, it was working again!

If you’re experiencing this on a local machine, then the above fix might work for you as well. However, if this is happening on a production server, then you might want to think about upgrading your software.