0

First of all let me start by saying that I have read and tried all approaches that I found on the web and stack overflow.

What I get when I try to run

mysql.server start

or

sudo /usr/local/mysql/support-files/mysql.server start

is

ERROR! The server quit without updating PID file (/usr/local/var/mysql/hostname.local.pid).

What I get when I try to run:

mysql

is

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I also tried:

  1. sudo mysqld_safe &
  2. Clicking the mysql start button on system preferences.
  3. Restart the computer
  4. Reinstall mysql
  5. Install older version of mysql
  6. killall and then try to run mysql
  7. sudo chmod -R 777 /usr/local/mysql/
  8. `sudo chown -R mysql /var/lib/mysql/
  9. rm /usr/local/var/mysql/localhost.err
  10. sudo /usr/local/mysql/bin/mysqld_safe start
  11. tried everything here: How to auto-load MySQL on startup on OS X Yosemite / El Capitan

I am out of ideas, I don't know what to do.

Community
  • 1
  • 1
RetroCode
  • 342
  • 5
  • 14

1 Answers1

0

What I did to actually make it work:

killall -u username
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
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 the computer

brew doctor and fix any errors
brew update
brew install mysql
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql.server start
RetroCode
  • 342
  • 5
  • 14