How to completely uninstall MySQL on MacOS

Viewed 7603

I followed another stackoverflow post to completely uninstall all instances of MySQL (I had 5..)

$ sudo rm /usr/local/mysql
$ sudo rm -rf /usr/local/mysql*
$ sudo rm -rf /Library/StartupItems/MySQLCOM
$ sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
$ 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*
$ sudo rm -rf /var/db/receipts/com.mysql.mysql*

And reinstalled using

brew install mysql

but when I start the server, I have to put in the old root user password, which means it's still storing the passwords somewhere.

Brew prompted me change the password which I did, and then I got this error

... Failed! Error: File './mysql/user.MYD' not found (Errcode: 2 - No such file or directory)

So clearly mysql hasn't been completely uninstalled.

1 Answers

Ended up solving it by running

ps -ax | grep mysql

then going to each of the folders and removing any mysql data

then uninstalling XAMPP

then restarting computer

then

brew install mysql
Related