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!
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);
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.