The main purpose of this article is to help you easily uninstall MySQL Ubuntu. As we all know that every operating system updating day by day. Almost there is not even a single day when we don’t get updates.
Complete Guide for MySQL is here for Developers & Suggested Book for you is here please check it out MySQL Optimization,Replication & Backup
In This Article
Uninstall MySQL in Ubuntu:
Although it is to be said that updates make our software or operating system more smooth but sometimes it got some issues as in most of the operating system the problem we got that it drains more battery in new updates. It is the minor effect that I tell you just for understanding. So I decided to uninstall MySQL from Ubuntu.
Ubuntu is a free and open-source Linux distribution based on Debian. Ubuntu is officially released in three editions: Desktop, Server, and Core. Ubuntu is a popular operating system for cloud computing, with support for OpenStack. Ubuntu is released every six months, with long-term support releases every two years.
While upgrading from Ubuntu 16.04.1 to Ubuntu 16.04.03, we faced one issue that was unexpected.
This incident is caused by MySQL server update while setting up the MySQL by apt, its hang on the server and will not work for leaving it around one hour.
So we decide to remove MySQL ubuntu server and reinstall again, below are the steps that we were done.
How to uninstall MySQL Ubuntu:
Here are the steps that helped us to uninstall MySQL in Ubuntu:
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-mysql
sudo apt-get dist-upgrade
sudo apt-get install mysql-serverYou will get this type of Pictures to remove MySQL from ubuntu after applying these steps.
How to remove MySQL Ubuntu (Alternative):
Due to different directories that we create in our operating system we got some problems with uninstalling MySQL. If this is still not working for you,
Follow these commands
service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql*
apt-get --yes autoremove --purge
deluser --remove-home mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld
/etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log*
If still not working for you, Please check any MySQL process running on your server, it can be view by using top command and service MySQL stop, otherwise, try step 3 before going through step 1 and 2.
Here is another way to remove MySQL ubuntu
Uninstall MySQL from Ubuntu and Install MariaDB
You may have heard about the upstart MySQL database MariaDB Getting Started with MariaDB, a branch of MySQL created in the wake of Oracle’s purchase of Sun Microsystems. You’ll find many great reasons to consider MariaDB, not least that MariaDB is led by the original author of MySQL, Monty Widenius. But there are reasons to stick with MySQL too for sometimes.
Step 1: Check that MySQL is installed
On Ubuntu 16.04/15.10/15.04:
On Ubuntu 14.10 and previous versions:
Step 2: Uninstall MySQL
if you want to install MariaDB on your system first you have to uninstall existing MySQL. Follow these steps to uninstall completely existing MySQL from the server.
1-sudo systemctl stop mysql
2-sudo apt-get remove --purge mysql-server mysql-client mysql-common
Step 3: Install MariaDB
When MySQL in uninstalled completely then run the following command to install MariaDB.
Step 4 (Final): Checking MariaDB is installed
Successfully Uninstall MySQL from Ubuntu:
After following all the steps as stated in the article, you will be able to completely remove and uninstall MySQL from Ubuntu. If you are still facing any issues, feel free to comment on your queries below. We’d assist you ASAP.