Migration from MySql 4 to 5
- Posted by Shaun on January 17th, 2007 filed in Xiaoniu
My host has asked everybody to move all databases over from MySql 4 to 5. I left it off my todo list until last weekend. I’ve been struggling since Saturday trying to get my blog database to covert. For most people it would have been a simple conversion. Not for me. I have English and Chinese characters in my blog.
After exchanging emails with support and plenty of trial and error I finally figured out that even though MySql 4 wasn’t configured with an encoding, my data was being stored as UTF8. I converted to MySql 5 UTF8 encoding and made a small modification to Wordpress core code (not usually a good idea) and things are working. I just have to keep an eye on things.
Next is migrating my Drupal site databases (Suafe and MCM) to MySql 5. I’m keeping my fingers crossed.
BTW feel free to comment. If things go awry I’ll fix things manually.
January 17th, 2007 at 8:44 pm
Interesting! Thanks for posting, good to know. Did you have to change wordpress in a lot of places or was it a pretty easy change?
January 18th, 2007 at 7:51 am
A single line change. Had to add “mysql_query(”SET NAMES ‘utf8′”) or die(’SET NAMES failed’);” so that Wordpress would display UTF8 characters properly. Not sure if this is necessary when using UTF8 with English characters only or if you need it anytime you are using UTF8.