xxxxxxxxxx
# ******Type the following in your terminal*******
sudo systemctl stop mysql
# OR
sudo service mysql stop
# Remove MySQL related all packages
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
# remove mysql configurations
sudo rm -rf /etc/mysql /var/lib/mysql
# (Optional) Remove unnecessary packages.
sudo apt autoremove
#(Optional) Remove apt cache
sudo apt autoclean
xxxxxxxxxx
sudo apt-get remove --purge mysql* -y
sudo apt-get autoremove -y
sudo apt-get autoclean