Reinstall MySql but keep database tables and data
If the database files are accessible, you can follow these steps:


mv /var/lib/mysql /var/lib/mysql.bkp
sudo apt-get install mysql-server 
sudo /etc/init.d/mysql stop
mv /var/lib/mysql.bkp /var/lib/mysql
sudo /etc/init.d/mysql start


It should work if you don't have any table file corruption.