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
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-*
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
Move ahead!
Step 4: Removing Unnecessary Packages
To remove unnecessary packages, run:
sudo apt autoremove
Step 5: Freeing Up Disk Space
Now, remove old packages to free up disk space of Ubuntu 24.04:
sudo apt autoclean
Step 6: Removing MySQL Configurations
As the last step, remove all configurations related to MySQL:
sudo apt remove dbconfig-mysql
I’m a professional technical content writer who has 4+ years of experience with different operating systems, programming languages, GUI-based apps, IT, and technology in general.