How to completely delete MySQL from Mac

If you want to uninstall or reinstall MySQL on your Mac, it’s not enough to drag into the Trash. To wipe it out completely, you need to remove all associated files, such as databases and configurations. Today, we’ll show you how to do that and uninstall MySQL from your Mac safely.

What is MySQL?

MySQL is a relational database management system (RDBMS) based on structured query language (SQL). Backed by Oracle, a multi-model database management system, this open-source software with a client-server module is integral to the most popular software stacks.

Giants like Google, Facebook, Twitter, YouTube, Yahoo!, and Adobe rely on MySQL for data storage purposes. Although it was initially created for limited use, now it’s available for macOS, Windows, Linux, and Ubuntu. As MySQL is a database, it can contain many data, therefore being the most prominent system on your Mac. So, if you want to delete it, I will show you how.

How to remove MySQL from your Mac manually

There are several ways to eliminate MySQL from your computer. Let’s see how you can do that manually. First, go to System Preferences and click MySQL. Press Uninstall to delete the service.


Now that you trashed the app, it’s time to remove all the related files, including databases. To get rid of these files, use Terminal. Follow the steps below:

Note:

Deleting MySQL includes removing all its databases. If you have critical data stored in MySQL, make sure to back up your files before removing the service from your Mac.

  1. Open Terminal from the Application folder.
  2. Back up your data with this command: mysqldump
  3. Check for any MySQL processes using this command ps -ax | grep mysql. If any are found, stop and terminate them. 
  4. Type the following command: sudo rm /usr/local/mysql. Enter your password if required.
  5. Execute the following commands consistently:
    sudo rm -rf /usr/local/mysql
    sudo rm -rf /usr/local/var/mysql
    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /private/var/db/receipts/*mysql*
  6. Remove the line MYSQLCOM=-YES- from /etc/hostconfig.

Now, if you check System Preferences, you won’t find MySQL there. Removing MySQL through Terminal may seem like a tiresome task.

Luckily, there is a much easier way to uninstall MySQL. Simply use a dedicated tool to quickly detect and remove MySQL and its files.

How to completely uninstall MySQL on Mac with a third-party uninstaller

CleanMyMac X is a utility toolbox for your Mac that shows all you have on your Mac. Apple notarizes it to be sure that it won’t conflict with any system settings. Here is how to uninstall MySQL with CleanMyMac X:

  1. Grab you a copy of CleanMyMac X — the free trial version is here.
  2. Launch it and go to the Extensions module in the sidebar.
  3. Select Preference and check the box next to MySQL.
  4. Hit the Remove button.
  5. Once done, go to the Leftovers tab in Uninstaller. Find any related files and get rid of them. 

    As simple as that! Now there’s no trace of MySQL left on your computer.

    As you can see, removing MySQL with Terminal is a long and tricky process. But there is a more straightforward way by using the Extensions feature of CleanMyMac X. 

    Hope that helped!

    Laptop with CleanMyMac
    CleanMyMac X

    Your Mac. As good as new.