Uninstalling MySql :

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

Installation:

sudo apt-get update
sudo apt-get install mysql-server

Note:- Incase you encounter an ‘error:alternative path /etc/mysql/mysql.cnf’ then purge the unconfigured mysql using the

command:’sudo apt-get remove –purge mysql-\*’

& reinstall with the following command below

command:’sudo apt-get install mysql-server mysql-client’