🐘
PHP & MySQL

Set MySQL charset UTF8MB4 in Plesk

πŸ“… 13 October 2026 ✏️ 13 October 2026 ⏱ 5 min leestijd

Learn how to convert MySQL databases to utf8mb4, why it matters for emoji’s and special characters, and how to set it up safely via Plesk.

If your website shows strange characters, question marks in boxes, or broken emoji’s, it’s usually because your database is still using the outdated charset utf8 or latin1 instead of utf8mb4. Utf8mb4 is the full UTF-8 implementation in MySQL/MariaDB and supports all Unicode characters, including emoji’s and special language characters. In this article, you’ll learn what utf8mb4 is, why it’s important, and how to set it up step by step without data loss.

What is UTF8MB4 and why use it

MySQL has multiple character sets for storing text. The older charset utf8 in MySQL is actually a limited variant that uses a maximum of 3 bytes per character. As a result, many modern characters, such as emoji’s and some Asian characters, cannot be stored correctly. Utf8mb4 uses up to 4 bytes per character and thus covers the full Unicode standard.

For a website or webshop, this becomes relevant as soon as users enter text that falls outside the basic Latin character set: names with accents, Asian languages, special punctuation marks, or emoji’s in reviews and chat messages. Without utf8mb4, such input and storage gets stuck or characters get corrupted.

Difference between utf8 and utf8mb4

The main difference lies in the maximum byte length per character. Utf8 in MySQL does not fully support the Basic Multilingual Plane, while utf8mb4 does. There is also a difference in collation: where utf8 uses, for example, utf8_general_ci, with utf8mb4 you usually work with utf8mb4_general_ci or the more precise utf8mb4_unicode_ci.

A practical consequence is that columns with an index can have a slightly smaller maximum length with utf8mb4, because each character takes up more space. On older MySQL versions, this could lead to error messages with long indexed text fields, but on modern versions with the correct settings, this is rarely a problem anymore.

DatabaseTableColumnutf8mb4all characters

Setting UTF8MB4 via Plesk

In Plesk, you can adjust the charset of a database via the built-in database management tool or phpMyAdmin. Go to Websites & Domains, open the Databases tab, and click phpMyAdmin next to the relevant database. There you can change the collation per database or per table to utf8mb4_unicode_ci via the Operations or Structure tab.

After making the change, always check that your CMS or application (such as WordPress or a custom script) also uses the correct charset in its configuration file, so that the connection between application and database remains consistent.

πŸ’‘ Tip: Always make a backup first before changing the charset. At Tandata, every hosting environment runs with daily backups, so you can easily restore in case of an error.

Setting UTF8MB4 via SQL commands

Would you rather make the change via SQL, for example in phpMyAdmin’s SQL tab or via the command line? Use the commands below as a basis.

1

Adjust database

Run: ALTER DATABASE your_database CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; to change the default charset of the entire database.

2

Adjust tables

Run for each table: ALTER TABLE your_table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; so existing columns are converted.

3

Check connection settings

Make sure your application connects using utf8mb4, for example via mysqli_set_charset($conn, "utf8mb4") in PHP, so data is sent and received correctly.

4

Test the result

Enter a test input with an emoji or special character and check whether it is stored and displayed correctly on the website.

Stuck on these steps? Check Tandata’s knowledge base at /nl/support/ for more explanation on database management, or contact 24/7 support via WhatsApp, ticket, or e-mail.

Frequently Asked Questions

Will I lose data when converting to utf8mb4?

Usually not, as long as the existing data already contains valid UTF-8 characters. To be safe, always make a backup before performing the conversion.

Do I also need to adjust my CMS after the conversion?

Yes, check the configuration file of your CMS or script and make sure the database connection also explicitly uses utf8mb4, otherwise characters may still be displayed incorrectly.

Does utf8mb4 work with all MySQL versions?

Utf8mb4 is supported from MySQL 5.5.3, but for full support of 4-byte characters and longer indexes, a more recent version is recommended.

Can I change the charset without downtime?

With smaller databases, you usually won’t notice the conversion at all. With large tables, it may take a while, so preferably perform this outside peak hours.

Does this also apply to e-mail data in the database?

Yes, if you store, for example, e-mail messages or contact form submissions in a database, utf8mb4 ensures that all characters are preserved correctly. Also check out the options for business e-mail at Tandata.

Conclusion

By converting your MySQL database to utf8mb4, you prevent display issues with emoji’s, accents, and special characters. Via Plesk or simple SQL commands, you can arrange this quickly, provided you first make a backup and check your application settings. Not sure about your current hosting environment? Check out the options for web hosting at Tandata.

View web hosting β†’

Was dit artikel nuttig?