Uninstall or Remove MySql 5.7 from Ubuntu 20.04 LTS.

Uninstall or Remove MySql from Ubuntu 18.04 LTS and Ubuntu 20.04 LTS
Uninstall or Remove MySql from Ubuntu 18.04 LTS and Ubuntu 20.04 LTS

Introduction


Hey in this tutorial we are going to tell you how you can completely remove or uninstall MySQL of any version from  Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. In this tutorial we are removing MySQL 5.7 , if you have different MySQL version then you can replace it.

Note:- Before uninstalling or removing MySQL make sure you have taken your database backup.

Also Read:- How to Install MySQL 8.0 on Ubuntu 20.04 LTS.

Also Read:- How to install Mysql 5.6 on Ubuntu 18.04 LTS.

Also Read:- How to install MySQL 5.5 on Ubuntu 20.04 LTS.

Also Read:- How To Install Linux, Apache, MySQL, PHP (LAMP) on Ubuntu 16.04, Ubuntu 18.04 and Ubuntu 20.04

Prerequisites:-

Need root user privileges.

Uninstall Mysql Server

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7                  
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get remove dbconfig-mysql
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /etc/mysql /var/lib/mysql
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
sudo apt-get dist-upgrade
sudo apt update



Below commands will remove by killing MySQL services which are running on the servers. Only you have to do is just copy and paste on the terminal.

sudo service mysql stop  #or mysqld
sudo killall -9 mysql
sudo killall -9 mysqld
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo deluser -f mysql
sudo rm -rf /var/lib/mysql
sudo apt-get purge mysql-server-core-5.7
sudo apt-get purge mysql-client-core-5.7
sudo rm -rf /var/log/mysql
sudo rm -rf /etc/mysql

Conclusion

Congratulation you have successfully uninstalled MySQL  from your Ubuntu Operating System. Let me know if you are facing any issue in the comment box. I will be very happy to answer those question. Happy learning .

Comments

Popular posts from this blog

Failed to establish the VPN connection. This may be caused by a mismatch in the TLS version.

To make SSL VPN connection work, please turn off IE security configuration | vetechno

How to install Mysql 8.0.29 on Ubuntu 22.04 LTS | vetechno