With the command:
sudo apt-get remove --purge mysql\*
you can delete anything related to packages named mysql. Those commands is only valid on debian / debian based linux distributions (for eg. ubuntu).
You can list all mysql packages installed with:
sudo dpkg -l | grep -i mysql
For more cleanup for package cache you can:
sudo apt-get clean
Otherwise the “locate” command will display old data.
To install mysql again, use the following command:
sudo apt-get install libmysqlclient-dev mysql-client
This will install mysql client, libmysql and its headers files.
To install the server, run this one:
sudo apt-get install mysql-server