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

Posted August 21, 2019 6.6k views
MySQLPHPDigitalOceanPHP FrameworksDatabases

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



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.

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.

Submit an Answer
6 answers


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:

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!

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.

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

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

  • For anyone with this problem, I’m running some tests with using proxysql between the APP and DB and it seems to work fine.

    Further testing needed, but so far it looks promissing.

    • I was able to connect using ProxySQL however I got some crashes in it (Signal 11 => SIGSEGV very very bad).

      Are you using this approach in some production environment?

I can’t use database Mysql DO becouse error.

Any solutions ?

other than this.

default-character-set = utf8

default-character-set = utf8

character-set-server = utf8
collation-server = utf8mb4unicodeci

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