"Failed to spawn mysql main process: unable to execute: No such file or directory"

I'm a newbie on MySQL ground so bear with me.

I've just finished upgrading 11.10 to 12.04.

Everything seemed to work without any hiccups and all my software and settings are working fine. Apart from MySQL.

When I try:

sudo start mysql

I receive an error:

start: Job failed to start

Where can I possibly diagnose what the problem is? And (hopefully) - how to sort it out?

(I disabled automatic start following advice here if that is of some importance)


Update 1:

Both outputs of:

cat /var/log/mysql.err 
cat /var/log/mysql.log

are empty.

Output of dmesg | grep mysql:

[ 1401.785141] type=1400 audit(1335619832.181:25): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=16165 comm="apparmor_parser"
[ 1401.791089] init: Failed to spawn mysql main process: unable to execute: No such file or directory

Update 2:

As indicated by AWinter below - it seemed that MySQL disappeared automagically after upgrade and had to be reinstalled.


Check that mysql-server-5.1 package was uninstalled, seems it might persist after upgrade. I had the same error and had to purge MySQL server 5.1 and 5.5 then re-install.

First make a backup of your /var/lib/mysql/ directory just to be safe.

sudo cp -R /var/lib/mysql/ ~/mysql

Next purge MySQL (this will remove php5-mysql and phpmyadmin as well as a number of other libraries so be prepared to re-install some items after this.

sudo apt-get purge mysql-server-5.1 mysql-common

Remove the folder /etc/mysql/ and it's contents

sudo rm /etc/mysql/ -R

Next check that your old database files are still in /var/lib/mysql/ if they are not then copy them back in to the folder then chown root:root

(only run these if the files are no longer there)

sudo mkdir /var/lib/mysql/
sudo chown root:root /var/lib/mysql/ -R
sudo cd ~/mysql/
sudo cp * /var/lib/mysql/ -R

Next install mysql server

sudo apt-get install mysql-server

Finally re-install any missing packages like phpmyadmin and php5-mysql.


sudo dpkg-reconfigure mysql-server-5.5