Question

Any way to disable charset-handshake and change default server charset in Managed MySQL?

Too many old products can’t connect to new MySQL8. All recommendations or rewrite old product, or change MySQL server settings like this:

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
skip-character-set-client-handshake
character-set-client-handshake = 0
collation-server = utf8_unicode_ci
character-set-server = utf8
default_authentication_plugin = mysql_native_password

But how to do it in Managed MySQL? Also “SET GLOBAL” way currently not available.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello!

To preserve the stability of the database cluster, users are not able to modify global variables. However, you can make this change on a database by database basis, as described here:

https://dev.mysql.com/doc/refman/8.0/en/charset-database.html

Here’s an example: ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Note however that this will just change the default charset for the database, all existing tables will have to be converted. You can do that with a command such as this one:

ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Hope it helps!

Yes, this is definitely an issue. I’d like to move to managed databases but I can’t connect to it from a legacy PHP apps.

The app is going to be dismissed, but until it exists it needs to work and it’s impossible to upgrade the app.

Please provide a way to change charset on managed DBs

I can’t use database Mysql DO becouse error.

Any solutions ?

other than this.

[client] default-character-set = utf8

[mysql] default-character-set = utf8

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

Are the folks at DO going to bother with a solution for this? Seriously, 1.2k views on this page should be enough for you to realise it’s something a few users have struggled with.

After a week preparing to migrate a site to DO I’ll have to find another provider and start it all again… fantastic

I have only FPM version, trurlmcbyte/php-fpm:hack (PHP 5.6.40)

Is there any resolution for this. I have followed your instructions above and it fails either way.

The mysql managed DB is useless to me if we can’t connect to it with PHP.