Talk:Convert latin1 to UTF-8 in MySQL

didn't want to edit the main page since I don't understand charsets in mysql, but I had a different issue:

followed the main recipe and accented characters were still all screwed up, so I did this:

mysqldump -u username -p dbname --default-character-set=latin1 > db.latin1.sql

Edited in vi: vi db.latin1.sql (mine is 40Mb only) %s/SET NAMES latin1/SET NAMES utf8/g %s/CHARSET=latin1/CHARSET=utf8/g :wq

created new database as suggested create database new_db character set utf8 collate utf8_general_ci;

added in my.cnf [mysqld] character-set-server=utf8 collation-server=utf8_general_ci

SKIPPED THE CONVERSION STEP and loaded mysql as is into the new utf-8 database.

mysql -u username -p newdbname < db.latin1.sql

in LocalSettings.php set $wgDBmysql5=True;

And all characters are fine now!