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
You must start server and add the root user.
Starting the server:
sudo /usr/local/mysql/support-files/mysql.server start
, or
sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &
, or
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
Add root user:
/usr/local/mysql/bin/mysqladmin -u root password your_password
Best Answer
Figured it out. Opened LaunchDaemon plist file to see the exact command which would run. Ran that manually to see the startup output and eventually came up with the solution:
If you need help tracking down startup errors, open
Console
and messages containing "mysql". In my case the process was quickly closing, causing an infinite loop of retries. To dig deeper, open this file to see how it's launched:From there we can see it basically runs
So at the command line try
and watch the startup output.