I have installed MySQL on my Macbook Pro some time ago but it didn’t work today. I got the error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I reinstalled MySQL and got the same error.
Eric Dennis on stackoverflow suggested to check if MySQL starts properly by running /usr/local/bin/safe_mysqld
.
Unfortunately, I got a -bash: /usr/local/bin/safe_mysqld: No such file or directory
. Eric suggested to see if /tmp/mysql.sock
existed. It didn’t. His next suggestion was to to:
mysqld stop
touch /tmp/mysql.sock
mysqld_safe restart
I got a permission denied error. I tried with sudo and MySQL didn’t work afterwards either.
The next suggestion was to install the tables manually using: