Skip to content

Instantly share code, notes, and snippets.

@Victorcorcos
Created August 28, 2017 00:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Victorcorcos/c7c7871858086b7545403eb471dc7638 to your computer and use it in GitHub Desktop.
Save Victorcorcos/c7c7871858086b7545403eb471dc7638 to your computer and use it in GitHub Desktop.
Installing mysql on your MacOS via brew
Removing MySQL completely
ps -ax | grep mysql
(stop and kill any MySQL processes)
brew remove mysql
brew cleanup
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
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*
(restart your computer just to ensure any MySQL processes are killed)
try to run mysql, it shouldn't work
Installing It
brew doctor and fix any errors
brew update
brew install mysql
brew services start mysql
mysql_secure_installation (here, you should provide a password for mysql)
Running it
mysql -u root -ppassword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment