A script to convert an entire MySQL/MariaDB charset from one charset to another
I recently had to add emoji support to a site which used the utf8 charset on a MariaDB 10.1 server.
To do this I needed to change the charset of the database/tables/columns to utf8mb4.
The following script will do this:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
This uses the excellent Percona Toolkit to change the table schema online to prevent downtime due to the tables being locked.