MySQL: Unistall and reinstall MySQL from terminal (Ubuntu)

From terminal execute the following statements:

sudo apt purge mariadb-*; 
sudo apt purge mysql-*; 
sudo rm -r /usr/share/mysql/; 

rm -r /etc/mysql/;  
sudo rm -r /lib/systemd/system/mysql.service;
sudo apt install mysql-server