Title: Demystifying MySQL&#8217;s UTF8MB4: A Guide to Character Encoding in Databases with WordPress in GCP and Cloud SQL
Author: Immanuel Raj
Published: April 2, 2024
Last modified: February 15, 2025

---

# Demystifying MySQL’s UTF8MB4: A Guide to Character Encoding in Databases with WordPress in GCP and Cloud SQL

[April 2, 2024](https://immanuelraj.dev/demystifying-mysqls-utf8mb4-a-guide-to-character-encoding-in-databases-with-wordpress-in-gcp-and-cloud-sql/)

—

by

[Immanuel Raj](https://immanuelraj.dev/author/iamimmanuelraj/)

in [Databases](https://immanuelraj.dev/category/databases/), [Google Cloud](https://immanuelraj.dev/category/gcp/)

Read Time

1–2 minutes

## UTF8MB4

Introduced in MySQL version 5.5.3, is an extension of the UTF-8 character encoding
scheme. While UTF-8 can encode 1.1 million characters, UTF8MB4 can encode the full
range of Unicode characters, including emojis and characters outside the Basic Multilingual
Plane (BMP).

 * `utf8mb4`: A _UTF-8_ encoding of the _Unicode_ character set using **one to four
   bytes** per character.
 * `utf8mb3`: A _UTF-8_ encoding of the _Unicode_ character set using **one to three
   bytes** per character.

In _MySQL_ `utf8` is currently an alias for `utf8mb3` which **is deprecated** and
will be removed in a future _MySQL_ release. At that point `utf8` **will become 
a reference to** `utf8mb4`.

So regardless of this alias, you can consciously set yourself an `utf8mb4` encoding.

[UTF-8](https://en.wikipedia.org/wiki/UTF-8) is a variable-length encoding. In the
case of UTF-8, this means that storing one code point requires one to four bytes.
However, MySQL’s encoding called “utf8” (alias of “utf8mb3”) only stores a maximum
of three bytes per code point.

The `utf8mb4` character set is useful because nowadays we need support for storing
not only language characters but also symbols, newly introduced emojis, and so on.

## Cloud SQL – GCP

Google Cloud Platform [GCP] by default enables and uses `**_utf8_**` when creating
a Database and that is aliased to **_`utf8mb3`_** which is okay for most cases.

I was trying this out when using wordpress and it was not enough of it for me.

So i was searching for a best option and i found out that **_`utf8mb4`_** was the
go to solution for it.

[The very famous and professional WordPress VIP also uses the same thing. So it is really a good practise and important one to do when it comes to db and wordpress](https://docs.wpvip.com/databases/supported-collations-charsets/).

[cloud sql](https://immanuelraj.dev/tags/cloud-sql/) [databases](https://immanuelraj.dev/tags/databases/)
[db](https://immanuelraj.dev/tags/db/) [gcp](https://immanuelraj.dev/tags/gcp/) 
[google cloud](https://immanuelraj.dev/tags/google-cloud/) [sql](https://immanuelraj.dev/tags/sql/)

[Previous:  Piping Bash](https://immanuelraj.dev/piping-bash/)

[Next:  Cloudflare Header Tips](https://immanuelraj.dev/cloudflare-header-tips/)

![Immanuel Raj Avatar](https://secure.gravatar.com/avatar/88db6e1fa27cf854075acbaa156189ace30cf3701b2d8640cd774280ead1d4d3?
s=80&d=mm&r=g)

## About the author

Software Developer & Technology Consultant

---

## Popular Categories

 * [Bible](https://immanuelraj.dev/category/bible/) (1)
 * [Cloudflare](https://immanuelraj.dev/category/cloudflare/) (1)
 * [Databases](https://immanuelraj.dev/category/databases/) (1)
 * [Docker](https://immanuelraj.dev/category/docker/) (1)
 * [Email](https://immanuelraj.dev/category/email/) (1)
 * [ERPNext](https://immanuelraj.dev/category/erpnext/) (3)
 * [Frappe](https://immanuelraj.dev/category/frappe/) (2)
 * [Github Actins](https://immanuelraj.dev/category/github-actins/) (1)
 * [God](https://immanuelraj.dev/category/god/) (1)
 * [Google Cloud](https://immanuelraj.dev/category/gcp/) (1)
 * [Hosting](https://immanuelraj.dev/category/hosting/) (2)
 * [Life](https://immanuelraj.dev/category/life/) (1)
 * [Linux](https://immanuelraj.dev/category/linux/) (13)
 * [ML](https://immanuelraj.dev/category/ml/) (1)
 * [Networking](https://immanuelraj.dev/category/networking/) (2)
 * [Security](https://immanuelraj.dev/category/security/) (2)
 * [Self Hosting](https://immanuelraj.dev/category/self-hosting/) (7)
 * [SSL](https://immanuelraj.dev/category/ssl/) (3)
 * [Terminal](https://immanuelraj.dev/category/terminal/) (1)
 * [Tools](https://immanuelraj.dev/category/tools/) (2)
 * [Uncategorized](https://immanuelraj.dev/category/uncategorized/) (8)
 * [Web](https://immanuelraj.dev/category/web/) (2)
 * [WordPress](https://immanuelraj.dev/category/wordpress/) (1)

---

## Useful Links

Links I found useful and wanted to share.

 * [Sponsor Me](https://github.com/sponsors/iamimmanuelraj)

---

## Search the website

Search