Uninstalling MySQL on MacOS - rajivkanaujia/alphaworks GitHub Wiki

Uninstall MySQL on MacOS

To reinstall MySQL, please see Installing MySQL using Homebrew

Steps to uninstall MySQL completely from MacOS

Find the process using MySQL

    $ ps -ax | grep mysql

Stop / Kill them

    $ kill <process id>

Since brew was used to install the previous installation, use the brew to remove it.

    $ brew remove mysql
    $ brew doctor

Check following directories and remove MySQL remnants

    /usr/local/
    /usr/local/var/
    ~/Library/LaunchAgents
    ~/Library/PreferencePanes
    /Library/StartupItems/
    /Library/PreferencePanes/
    /Library/Receipts
    /private/var/db/receipts

Try following commands to remove MySQL specific items

    $ sudo rm /usr/local/mysql
    $ sudo rm -rf /usr/local/var/mysql
    $ sudo rm -rf /usr/local/mysql*
    $ sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    $ sudo rm -rf /Library/StartupItems/MySQLCOM
    $ sudo rm -rf /Library/PreferencePanes/My*
    $ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    $ rm -rf ~/Library/PreferencePanes/My*
    $ sudo rm -rf /Library/Receipts/mysql*
    $ sudo rm -rf /Library/Receipts/MySQL*
    $ sudo rm -rf /private/var/db/receipts/*mysql*

Remove any MySQL specific items from hosts file

    $ open -e /etc/hosts

Note: If you like the instructions here, please refer it on your posts/documentation. Contact me if there are corrections needed.

⚠️ **GitHub.com Fallback** ⚠️