Skip to content

Instantly share code, notes, and snippets.

@lilongen
Last active July 27, 2016 07:17
Show Gist options
  • Save lilongen/fd6e70e5c9e0d0362a62391dc770d982 to your computer and use it in GitHub Desktop.
Save lilongen/fd6e70e5c9e0d0362a62391dc770d982 to your computer and use it in GitHub Desktop.
mysql support utf8mb4
https://mathiasbynens.be/notes/mysql-utf8mb4
my.cnf
...
[client]
default-character-set = utf8mb4
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
...
# For each database:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
# For each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# For each column:
ALTER TABLE table_name MODIFY column_name VARCHAR(xxx) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment