MySQL won't start!

On Ubuntu 12.04 I had this same problem after changing buffer sizes in /etc/mysql/my.cnf file, I think I got a little carried away. Anyway after trying to change them back to the default setting MySQL still would not start.

I tried several different methods to get it resolved, I did notice that /var/run/mysql/mysql.sock was missing. This could be an issue so you may check there and if its missing you can replace it by doing the following:

sudo touch /var/run/mysql/mysql.sock
sudo chown mysql /var/run/mysql/mysql.sock

This did NOT fix the problem for me! But it may for some.

What I had to do was completely reinstall MySQL, to do this you will need to use the sudo command. The steps to completely removing and reinstalling MySQL are as follows:

Remove MySQL

sudo apt-get --purge remove mysql-server
sudo apt-get --purge remove mysql-client
sudo apt-get --purge remove mysql-common

Optionally you may use aptitude, by replacing apt-get --purge with aptitude

Clean UP

sudo apt-get autoremove
sudo apt-get autoclean

Remove MySQL dir

sudo rm -rf /etc/mysql

Install MySQL

sudo apt-get install mysql-server mysql-client

MySQL should now be running, you can check this by doing the following:

sudo service mysql status

You should see

mysql start/running, process xxxxx

Hope this helps, and thought I might add after doing this all my databases and tables where still available, however I did have to recreate the users and passwords for those databases.

Note: If you had mysql extension for php, you will need to reinstall this too.

sudo apt-get install php5-mysql

WARNING: This is dangerous, your mysql will NOT be safe and anyone will be able to connect, edit, etc your tables, do not leave your server running with this command.

Try starting it in safe mode: /usr/local/mysql/bin/safe_mysqld --user=mysql --skip-grant-tables

If this works then there might be problems with your information_schema or your mysql table(s). If it doesn't work than something is wrong with your install.


Check your log files as in the other answers. Also, check that you have enough (or any disk-space). MySQL can behave in this way on an empty partition.

df -h

If it's not that, check out MySQL's docs on debugging a server. Their myisamchk (if you're using MyISAM) is particularly useful.


I also recently got this problem after updating ubuntu. Not yet sure what exactly the problem is. One worakround that worked for the moment to get mysql running though was to do:

sudo aa-complain /etc/apparmor.d/*mysql*

That makes it work, indicating that apparmor stopped mysql from running, and explaining why the logs are empty probably too: mysql was not allowed to run.

It remains an odd issue, as so far there are no "complaints" from this in /var/log/apparmor, and the only audit entry in kern.log are from chaning the profile to complain mode.

Note that in doing this I also added an (empty) /etc/apparmor.d/local/usr.sbin.mysql file as the aa-complain commanded complained about not finding this file.