Report this

What is the reason for this report?

I'm trying to use a managed database but without success.

Posted on January 15, 2020

Hi, I created a managed database to use with my droplet, imported all fine but when trying to connect via php I get this error “Server sent charset unknown to the client.” I understand this is caused by the utfmb4 charset that is configured in the MySql from the managed instance. How can I change this (to the database level and not schema or table level) so I can work with it? Thanks



This textbox defaults to using Markdown to format your 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.

Can you recreate a db with utf8, re import and try again?

Other fixes usually have to do with mysql config, but you don’t have access to it with a managed instance

Any News about this? I also cannot connect from my PHP application due to the same error “Server sent charset unknown to the client”. Recreation did not fixed it…

Actually you can’t change managed database server’s chartset. So here work around only to change your php script to connect with server using utfmb4.

If you can post your database connection code then we can help you.

Here is sample code to connect with server using utfmb8 in php with pdo.

self::$instance = new PDO('mysql:host=' . DB_HOST . ';port=' . DB_PORT . ';dbname=' . DATABASE . ';charset=utf8mb4', DB_USER, DB_PASS, $pdo_options);

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.