Uninstall MySQL Server on macOS

Soufiane Rafik
1 min readOct 10, 2017

--

When you first install MySQL, it generates a temporary password for the root@localhost that you must change after the first connection. A lot of users had problems with the temporary password on macOS devices, including myself.

After desperately looking for a solution for hours, I decided to uninstall and re-install MySQL completely from my mac.

These are the steps to completely delete MySQL from your mac (Including all databases) :

  • Open a terminal window
  • Use mysqldump to backup your databases to txt files if you have them.
  • Stop the MySQL server
  • 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*

“Uninstalling a program is always the last thing to do when we have no choice.”

--

--