How I Fixed MySql on my Mac

Used brew’s remove & cleanup commands, unloaded the launchctl script, then deleted the mysql directory in /usr/local/var, deleted my existing /etc/my.cnf (leave that one up to you, should it apply) and launchctl plist

brew remove mysql

brew cleanup

launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist

rm ~/Library/LaunchAgents/com.mysql.mysqld.plist

sudo rm -rf /usr/local/var/mysql

I then started from scratch:

  1. installed mysql with brew install mysql
  2. ran the commands brew suggested:unset TMPDIR

    mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

  3. Start mysql with mysql.server command, to be able to log on it
  4. Used the alternate security script:
  5. Followed the launchctl section from the brew package script output
  6. Boom.

Leave a Reply

Your email address will not be published. Required fields are marked *