Aron Lilland Aron Lilland - 4 years ago 123
SQL Question

error installing mysql through homebrew cant connect to server through socket

i am having an issue trying to connect to my mysql after installing it with homebrew...

im unsure what my next steps should be in order to troubleshoot/fix, i am going step by step with an online video tutorial and it doesnt offer me any advice.

the error:

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


location of installation:
/usr/local/bin/mysql


version:
mysql Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using EditLine wrapper

Answer Source

First of all, make sure MySQL is up and running:

mysql.server start &
ps axffu|grep mysql

the above should print out the pid of running mysql process.

If this did not resolve an issue, try to locate the socket:

find /usr/local/mysql -name mysql.sock
find /var/mysql -name mysql.sock

and either update your configuration, or just create a symbolic link to it:

sudo ln -s FOUND_LOCATION /tmp/mysql.sock
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download