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
This is a service that is started and stop "as-needed" by the ngen
(Native Image Generator) executable. According to this MSDN page, the service typically starts in conjunction with a installation program (installer) or by direct interaction with the ngen executable.
As far as I know, the behavior you described is standard/correct behavior.
Best Answer
if you are experiencing this problem (error 0 cannot start the service mysql) try this solution: first of all uninstall mysql from your computer and delete all files associated with mysql go to the start menu of your computer and type regedit (registry editor) avigate the regedit to HKEY_LOCAL MACHINE/SYSTEM/CURRENT CONTROL SET/SERVICE then delete anything to do with mysql after that install your mysql again and it will install successfully