How to Uninstall MySQL From Ubuntu 24.04: Quick Guide

Looking for an easy way to uninstall MySQL from Ubuntu 24.04? 

Let’s roll in!

How to Remove or Uninstall MySQL From Ubuntu 24.04

If you have already installed MySQL on Ubuntu 24.04, and don’t need it anymore. Follow these steps:

Step 1: Stopping MySQL service

Firstly, stop the MySQL service via:

sudo systemctl stop mysql
stopping mysql service in ubuntu 24.04

Step 2: Removing Core Components

Next, remove all the MySQL-related core components and their configurations:

sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
removing core components from ubuntu 24.04

Step 3: Uninstalling Related Files

After that, remove MySQL-related files that are left behind in the folder:

sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql
uninstalling mysql related files in ubuntu 24.04

Move ahead!

Step 4: Removing Unnecessary Packages

To remove unnecessary packages, run:

sudo apt autoremove
removing uneccessary packages from ubuntu 24.04

Step 5: Freeing Up Disk Space

Now, remove old packages to free up disk space of Ubuntu 24.04:

sudo apt autoclean
freeing up disk space in ubuntu 24.04

Step 6: Removing MySQL Configurations

As the last step, remove all configurations related to MySQL:

sudo apt remove dbconfig-mysql
removing mysql configurations files from ubuntu 24.04

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top