Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created October 17, 2017 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisleech/fa08d51c206d5d4acbedabdf50016ea9 to your computer and use it in GitHub Desktop.
Save krisleech/fa08d51c206d5d4acbedabdf50016ea9 to your computer and use it in GitHub Desktop.
change encoding/collation of MySQL database/table
When table/db is Latin1 and you have UTF data convert source db to UTF before import:
```
show full columns from documents;
ALTER DATABASE mos_production CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE mos_production
ALTER TABLE documents CONVERT TO 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