Alcides Fonseca

40.197958, -8.408312

Fix encodings in MySQL Database

Before you start: backup your database. Even if you are not experience any issue.

When migrating a redmine database between two servers, the encodings got screwed even though both databases were using UTF-8 (the lingua franca of the web that was supposed to avoid this kind of problems).

Anyway, the trick is to make sure you have every table defined as UTF-8.

The problem is that the content of the database is still fucked up. To solve this, you can use the following script that uses triple convert (latin1 -> binary -> utf8) on every column of every table in the database.