TIMEX TIMEX - 8 months ago 24
MySQL Question

In MySQL, what do I put inside my.cnf so that all tables are UTF-8 that works with emojis by default?

I'd like every table and database (to be created) to be utf-8 that works with emojis. I understand that there are a few variables I need to define inside


init_connect='SET collation_connection = ??? '
init_connect='SET NAMES ???'
character-set-server = ???
collation-server = ???

However, I'm not sure what to put in the
. What do I put inside

eol eol

This article may help: https://mathiasbynens.be/notes/mysql-utf8mb4#utf8-to-utf8mb4

It explains in detail how to switch to utf8mb4 to support full unicode, thus allowing emojis using the following config:

default-character-set = utf8mb4

default-character-set = utf8mb4

character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci