Last active
July 27, 2016 07:17
-
-
Save lilongen/fd6e70e5c9e0d0362a62391dc770d982 to your computer and use it in GitHub Desktop.
mysql support utf8mb4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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