Converting a database from latin1 to utf8
Posted: Mon Feb 05, 2007 2:48 am
Is there a way to convert the character set of an entire database without having to dump it all, change the settings in the dump file, and rebuild it?
I've written a script that can scan through the database changing all the collations, and I think I can do the same for column charsets, but is there a way to change the charset of a table using ALTER TABLE rather than dropping it and then using CREATE TABLE? I don't really want to have to rebuild this whole thing from a backup because it's 300 very large tables.
This is in MySQL 4.1.
(I've read:
http://dev.mysql.com/doc/refman/4.1/en/ ... rsion.html
http://www.oreillynet.com/onlamp/blog/2 ... in1_t.html
...any other links appreciated though)
I've written a script that can scan through the database changing all the collations, and I think I can do the same for column charsets, but is there a way to change the charset of a table using ALTER TABLE rather than dropping it and then using CREATE TABLE? I don't really want to have to rebuild this whole thing from a backup because it's 300 very large tables.
This is in MySQL 4.1.
(I've read:
http://dev.mysql.com/doc/refman/4.1/en/ ... rsion.html
http://www.oreillynet.com/onlamp/blog/2 ... in1_t.html
...any other links appreciated though)