Debian: MySQL stops working after upgrade from Lenny to Squeeze

MySQL installation gets upgraded during your OS upgrade as well… therefore a few different things could cause the server to not start. I’d start troubleshooting this way:

Incompatible configuration: simply backup your /etc/mysql/my.cnf and copy a new one from /etc/mysql/my.cnf.dpkg-dist and start the server.
cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
cp /etc/mysql/my.cnf.dpkg-dist /etc/mysql/my.cnf
/etc/init.d/mysql restart

 

Missing loopback interface: MySQL binds to your loopback interface by default and would not start if it is missing. Check yours and add if necessary:
nano /etc/network/interfaces
and add “lo” to lines with “auto”. If your interface line is “auto eth0” change it to read “auto lo eth0”. Also add “iface lo inet loopback” to the file if it is missing. Save config and restart the server.

 

2nd last resort: install MySQL: Install it again, see what happens.
aptitude install mysql-server-5.1
 

Last resort: completely purge the install and install again:
aptitude remove --purge mysql-server
aptitude install mysql-server

and if none of the above worked keep googling… good luck!