Each time I tried to stop / start /restart mysql server, it ended in a ‘failed!’ message: Starting MySQL
database server: mysqld . . . . . . . . . . . . . . failed!
I killed it through its pid, updated mysql package and it was unable to start again!!!!!
After looking at /var/log/syslog, I had multiple error messages such as:
error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
mysql invoke-rc.d: initscript mysql, action “start” failed
After a couple of hours, I tried quick and dirty fix advised here (http://www.debianhelp.org/node/1962), I simply remove my mysql config file:
sudo mv /etc/mysql/my.cnf /etc/mysql/my.cnf.customBackup
After this, I was able to restart mysql (safely restart mysql through ‘sudo mysqld_safe‘ command).
note1: it seems source of the problem was that I kept my old mysql configuration file when upgrading from mysql5.0 to mysql5.1
So far I have not found any mysql config file checker as it can exist for apache2 (“apache2ctl configtest”)
note2: recommended step is now to use default my.cnf file (sudo cp /etc/mysql/my.cnf.dpkg-dist /etc/mysql/my.cnf) and configure it the way you want