1. Home
  2. MySQL Tutorials
  3. Uninstall MySQL 8 on Ubuntu 18.04/16.04 LTS

Uninstall MySQL 8 on Ubuntu 18.04/16.04 LTS

Previous article we have covered How to Install MySQL 8.0 on Ubuntu 18.04. In this tutorial , We are going to cover How to Uninstall MySQL 8 on Ubuntu 18.04/16.04 LTS Step by Step or any Cloud Instance like Amazon EC2, Azure VM, Google Compute Engine,etc. with preinstalled MySQL 8.0 and Ubuntu 18.04/16.04.

Prerequisites

  • Ubuntu 18.04/16.04 LTS System
  • SSH access with sudo privileges

Uninstall MySQL packages using below command.

sudo apt-get remove --purge mysql-server mysql-client mysql-common

Output:

Do you want to continue? [Y/n] :  y

---

It asks to remove data directories, if you want to remove, Enter on Yes button.

Uninstall MySQL 8 on Ubuntu

To remove MySQL community client core packages.

sudo apt-get remove mysql-community-client-core

Output:

Do you want to continue? [Y/n]: y


To remove MySQL community Server core packages.

sudo apt-get remove mysql-community-server-core

Output:

Do you want to continue? [Y/n]:  y


To remove undependent packages .

sudo apt-get autoremove

Output:

Do you want to continue? [Y/n]: y

To clean local apt  pacakges.

sudo apt-get autoclean

By default mysql stores MySQL data files at /var/lib/mysql location. Run below commands to remove mysql backup files if you don’t need.

sudo rm -rf /var/lib/mysql

Conclusion:

In this article, We have covered, How to Uninstall MySQL 8 on Ubuntu 18.04/16.04 LTS Step by Step.

Related Articles:

How to Download and Install MySQL 5.7 on Ubuntu 18.04

Reference

MySQL Official Documentation

Tags

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.