Change MySQL 5.5 default character-set to UTF8

Last night cPanel upgraded the version of MySQL on one of our servers to the latest MySQL 5.5. Unfortunately this results in over 4000 emails from that server, crying that various websites couldn't connect to the MySQL database. The error found in /var/log/mysqld.log was

InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 26214400 bytes!
131218 23:06:21 [ERROR] Plugin 'InnoDB' init function returned error.
131218 23:06:21 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
131218 23:06:21 [ERROR] /usr/sbin/mysqld: unknown variable 'default-character-set=utf8'
131218 23:06:21 [ERROR] Aborting

Read more…

Replace DB content on the fly

This appears to be a little known fact, so it has earned the right to be posted as a how-to on my site. If you have a database with lots of content and you discover to your dismay that you have made…

Read more…