Skip to content

Instantly share code, notes, and snippets.

View jack3898's full-sized avatar

Jack Wright jack3898

View GitHub Profile
@jack3898
jack3898 / Convert collation MySQL MariaDB.md
Created July 28, 2021 08:37
A couple of queries that let you convert an entire database into a new collation.

Converting database collations for large databases (MySQL/MariaDB)

Make sure Barracuda is enabled and the default character set globally is set to your desired character set in my.cnf.

Query 1

ALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci Of course, feel free to change the collations to what best suits you.

Then, get all of the queries to update the database tables and columns replacing the values that suit your situation: