Question

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

Posted August 21, 2019 1.3k 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:

[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.

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.

×
4 answers

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!

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.

Submit an Answer