In this post we will discuss how to delete mysql server.
This post assumes you have running instance of mysql server which you want to remove or the corrupted one which you want to get rid of...
In the former case let us confirm first that the server is not running...
use the following command to check the server is running or not
if the server is running then shut it down first as follows...
Now we are going to perform the action intented... which is removing the mysql service
execute the following commands in order as they are mentioned at the terminal
Deleteing the mysql directory in /etc and /var/lib
Well that is it, please post your comments if you encounter any issue while removing the instance thanks.
If you want to backup the database before removing MySQL service, you can refer the post
How to take MySQL dump using the command utility "mysqldump"
How to take MySQL dump using the command utility "mysqldump"
This post assumes you have running instance of mysql server which you want to remove or the corrupted one which you want to get rid of...
In the former case let us confirm first that the server is not running...
use the following command to check the server is running or not
> service mysql status or systemctl status mysqlthe response would let you know whether the server is running or not
if the server is running then shut it down first as follows...
> sudo service mysql stopuse "service mysql status" to check the server has come to a stop.
Now we are going to perform the action intented... which is removing the mysql service
execute the following commands in order as they are mentioned at the terminal
> 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
Deleteing the mysql directory in /etc and /var/lib
> sudo rm -rf /etc/mysql
> sudo rm -rf /var/lib/mysql
If you want to install MySQL Server again, you can check my post
MySQL Server Installation in Ubuntu - 18.10
MySQL Server Installation in Ubuntu - 18.10
Well that is it, please post your comments if you encounter any issue while removing the instance thanks.
No comments:
Post a Comment