How to Remove MySQL Completely from Linux System

Note: Please do not use below steps if MySQL have any running databases.(Stop the server First)

Step 1: Uninstall MySQL Packages

# yum remove mysql mysql-server


# rpm -e <rpm name>

Step 2: Remove MySQL Directory(Rename it to keep Backup also)

# mv /var/lib/mysql /var/lib/mysql_old_backup

Step 3: Install MySQL Packages Again

After removing MySQL completely, install it again using yum package manager, It will re create mysql directory under /var/lib/.

# yum install mysql mysql-server (OR) rpm -e <package name>

—-After completing above three steps, now you have a fresh MySQL install on your system with new settings—

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: