MacOS – Uninstall MySQL

macosmampMySQL

I'm trying to get a working copy of MAMP. But I once installed the MySQL server seperately, and I can't find a way to uninstall.

enter image description here enter image description here

How can I uninstall this version of MySQL?

Best Answer

The answer to this superuser question and this stackoverflow question both say approximately the same thing, that you need to perform the following actions:

If you haven't yet rebooted your computer, the process could still be running. First, reboot.

Then if MySQL is still showing up after a reboot, from the Terminal, issue the following commands one at a time:

  • sudo rm /usr/local/mysql
  • sudo rm -rf /usr/local/mysql*
  • sudo rm -rf /Library/StartupItems/MySQLCOM
  • sudo rm -rf /Library/PreferencePanes/My*
  • rm -rf ~/Library/PreferencePanes/My*
  • sudo rm -rf /Library/Receipts/mysql*
  • sudo rm -rf /Library/Receipts/MySQL*

And using your text editor of choice:

  • Edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

If you still cannot install or run a different version of MySQL, you might have to issue one last command in the Terminal:

  • sudo rm -rf /var/db/receipts/com.mysql.mysql*