the itjerk

my adventures with technology

Ubuntu 11.10 mysql problem after upgrade

If you find that mysql doesn't run after upgrading to 11.10, it could an issue with the fact that /var/run was replaced with /run.

Check /var/log/mysql/error.log, and you'll find something like this:

111104 19:11:33 [Note] Plugin 'FEDERATED' is disabled.
111104 19:11:33  InnoDB: Initializing buffer pool, size = 8.0M
111104 19:11:33  InnoDB: Completed initialization of buffer pool
111104 19:11:34  InnoDB: Started; log sequence number 0 44233
111104 19:11:34 [ERROR] Can't start server : Bind on unix socket: Permission den
111104 19:11:34 [ERROR] Do you already have another mysqld server running on soc
ket: /var/run/mysqld/mysqld.sock ?
111104 19:11:34 [ERROR] Aborting

Or if you try to login to mysql, you'll get this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Well, here's the fix! Go edit /etc/apparmor.d/usr.sbin.mysqld as root and replace

  /var/run/mysqld/ w,
  /var/run/mysqld/mysqld.sock w,


  /{,var/}run/mysqld/ w,
  /{,var/}run/mysqld/mysqld.sock w,


sudo service mysql restart

and viola! our mysql db's are back!

Comments are closed.

%d bloggers like this: