Skip to content

Instantly share code, notes, and snippets.

@kjbrum
Last active December 5, 2020 19:34
Show Gist options
  • Save kjbrum/2a88468dc87d876e6a4a671d973e9866 to your computer and use it in GitHub Desktop.
Save kjbrum/2a88468dc87d876e6a4a671d973e9866 to your computer and use it in GitHub Desktop.
Completely remove MySQL and reinstall.

Reinstall MySQL

https://coderwall.com/p/os6woq/uninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks

Uninstall MySQL

ps -ax | grep mysql (stop and kill any MySQL processes)

brew unlink [email protected]
brew remove [email protected]
brew cleanup
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm /usr/local/my.cnf
sudo rm /usr/local/etc/my.cnf
sudo rm -rf /usr/local/Cellar/mysql
sudo rm -rf /usr/local/var/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*
sudo killall mysqld

NOTE: It's best to restart your computer to make sure all MySQL processes are killed.

Install MySQL (5.7)

brew update
brew install [email protected]

# Optional: May be required to get MySQL started
brew services start [email protected]
brew link [email protected] --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment