Sometimes we may need to uninstall or purge MySQL from ubuntu. In this article, I will share steps to uninstall MySQL from Ubuntu 20.04. So, let’s get started.
Remove MySQL | Uninstall MySQL from Ubuntu 20.04
Before removing MySQL. first, make sure your MySQL service is stopped. To stop MySQL, run the following command.
$ sudo systemctl stop mysql
Also, you have to kill the MySQL processes. Check and kill the MySQL processes by the following commands.
$ sudo killall -9 mysql
$ sudo killall -9 mysqld
- killall: killall command kills processes by name. killall orders end running cycles dependent on their names and different attributes. A killall process never kills itself.
Steps to Remove MySQL from Ubuntu 20.04
To uninstall or purge MySQL from Ubuntu, open the terminal and run the following commands.
1. sudo rm -rf /var/log/mysql
2. sudo rm -rf /etc/mysql
3. sudo rm -rf /usr/bin/mysql
4. sudo deluser -f mysql
5. sudo apt autoremove
6. sudo apt autoclean
Read Here: How to fix MySQL 1064 Error.
Conclusion
In this short article, you have learned to uninstall MySQL from Ubuntu 20.04. If you like this article, please share it on your social media handle.