Here are detailed instructions combining getting rid of all MySQL from your Mac then installing it The Brew Way as Sedorner wrote above:
Remove MySQL completely per The Tech Lab
ps -ax | grep mysql
- stop and
kill
any MySQL processes 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 lineMYSQLCOM=-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 /tmp/mysql*
- try to run
mysql
, it shouldn't work
Brew install MySQL per user Sedorner from this StackOverflow answer
-
brew doctor
and fix any errors -
brew remove mysql
-
brew cleanup
-
brew update
-
brew install mysql
-
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp # whoami is executed inline
-
mysql.server start
-
run the commands Brew suggests, add MySQL to
launchctl
so it automatically launches at startup
mysql
should now work and be running all the time as expected