How To Completely Removing MySQL Server in CentOS

Completely Removing MySQL Server in CentOS

In this tutorial, we will show you how to complete removing MySQL on your CentOS server. For those of you who didn’t know, MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. The MySQL source code is freely available because it was originally developed as freeware. MySQL is written in C and C++ and is compatible with all major operating systems. MySQL can be used for a variety of applications but is most commonly found on Web servers.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step removing MySQL on the CentOS server. Maybe it’s a good idea to backup databases before doing this.

Completely Removing MySQL Server in CentOS

Step 1: Checklist the MySQL rpm which is installed on the server

#rpm -qa | grep mysql
#yum list installed | grep mysql

Completely Removing MySQL Server in CentOS

Step 2: Removing MySQL Server in CentOS.

Now we remove all MySQL-related packages using the following commands below:

#yum remove mysql-client mysql-server mysql-common mysql-devel

 Completely Removing MySQL Server in CentOS

Step 3: Delete the databases folder

#rm -rf /var/lib/mysql/
#rm -rf /etc/my.cnf

 If you don’t know how to reinstall the MySQL database server, check out our tutorial here.

Congratulations! You have successfully removed MySQL. Thanks for using this tutorial for removing MySQL from the CentOS system. For additional help or useful information, we recommend you check the official MySQL website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!