MySQL server won’t start after Ubuntu 11.04-11.10 upgrade
I just upgraded my Ubuntu server from 11.04 to 11.10 through the update tool. Almost everything went smooth, but the MySQL server won't start. The reason was that the configuration of AppArmor has changed, and apparently I said yes to keep my old AppArmor configuration for mysqld file doing the upgrade.
I found out by doing a fresh installation of Ubuntu 11.10, comparing all files in /etc/ and found that /etc/apparmor.d/usr.sbin.mysqld was changed.
The solution is to open /etc/apparmor.d/usr.sbin.mysqld and replace
/var/run/mysqld/mysqld.pid w,
/var/run/mysqld/mysqld.sock w,
with
/{,var/}run/mysqld/mysqld.pid w,
/{,var/}run/mysqld/mysqld.sock w,
The reason for the change, is that Ubuntu has merged a number of tmpfs into one single tmpfs, which is explained at askubuntu.com under Why has /var/run been migrated to /run?
