Skip to content

Instantly share code, notes, and snippets.

@ryanorsinger
Created May 21, 2021 23:10
Show Gist options
  • Save ryanorsinger/09a2a1fc9b14fccd3883c90243e63d41 to your computer and use it in GitHub Desktop.
Save ryanorsinger/09a2a1fc9b14fccd3883c90243e63d41 to your computer and use it in GitHub Desktop.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

MacOS:

  • $ brew services stop mysql

  • $ brew services list

  • $ brew uninstall mysql

  • $ brew install mysql

  • $ brew postinstall mysql

If Any error found then run those cmd

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

  • $ sudo rm /usr/local/etc/my.cnf

  • $ brew postinstall mysql

  • $ brew services start mysql

  • $ mysql_secure_installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment