MySQL: Converting from latin-1 to utf-8

This week I had to switch a MySQL DB from a latin-1 host to a UTF-8 host (Webserver with Forum/CMS). I have never managed to make this work with only setting the codepages right.

I have put together a perl script that takes the databases and their tables from the one host, encodes it to UTF-8 and inserts the data in the new host.

I hope someone finds this useful: sqlcopyconv.txt

PS: You need to have all the Tables in the new DB created already. But without data.

Leave a Reply

Your email address will not be published. Required fields are marked *