DEV Community

Fega Suseno
Fega Suseno

Posted on • Edited on

Remove MySql 5.7 on Ubuntu 20.04

Hello friends,
In this post, we’ll discuss how to completely remove MySQL 5.7 on Ubuntu. To remove completely MySql on ubuntu
Run following command :

apt remove --purge mysql-server mysql-client mysql-common
Enter fullscreen mode Exit fullscreen mode

You will see a confirmation prompt for removing MySQL. Press yes. Then, delete the MySQL directory:

rm -rf /var/lib/mysql
Enter fullscreen mode Exit fullscreen mode

Also, run the following commands to clean up all the cache:

apt autoremove
Enter fullscreen mode Exit fullscreen mode
apt autoclean
Enter fullscreen mode Exit fullscreen mode

After everything is done, confirm by running the mysql command, the service should no longer exist.

Hope this helps!

Top comments (0)