Pleh

I will smack you like a bad bad donkey, ok?

WordPress MySQL Character Set Encoding Conversion

Posted by pete on December 21st, 2008

I recently upgraded my WordPress install to the newest, version 2.7. In the process, I started looking at some plugins. One that caught my eye was Joe Tan’s, Flickr Photo Album for WordPress. Off I went to install it. A couple minutes later, I head off to configure it, only to discover that it’s complaining about about the character set encoding the back-end MySQL database uses.

I’m a long-time WordPress user. I’ve been using it since, I believe, pre-1.0 days. Over time, the database schema and database have grown and changed. The cruft has grown. In version 2.2 of WordPress, it became possible to set the character set encoding that WordPress uses. The default is UTF-8. Unfortunately, the default for the database was Latin-1. This could lead to some problems and the Flicker Photo Album for WordPress almost requires that this get fixed up.

Luckily for me — since I know next-to-nothing about character set encoding — Joe also included a link to this page, talking about the database character set. That page, in turn, led to this page, explaining ways to convert. All gung-ho to convert, I follow the SQL and after obtaining the OK of my fellow WordPress users on this system, I planned a little outage for the conversion.

Sadly, the conversion on that page didn’t work. Luckily, I did have a backup and I did find this page. I copied that backup file, fired up vim, did a little “:%s/latin1/utf8/g”, saved, and dropped/created the new database, and inserted the edited backup. After editing the wp-config.php files to include “define(‘DB_CHARSET’, ‘utf8′);”, things are back up and they look happy.

Now, to try out that Flicker Photo Album for WordPress plugin. Good thing I’m on vacation these next couple weeks.

Oh, by the way, the Subversion upgrade option for WordPress rocks.

Leave a Reply

You must be logged in to post a comment.

 
180893 pages viewed, 20 today
49079 visits, 9 today
FireStats icon Powered by FireStats