ERROR#: 2002 can't connect to MySQL server through socket '/var/mysql/mysql.sock'

ERROR#: 2002 can't connect to MySQL server through socket '/var/mysql/mysql.sock'

Post by Travis Hee » Sun, 11 Mar 2007 06:10:58


I was following this adobe article
( http://www.yqcomputer.com/ ) to set up
PHP and MySQL and connect a MySQL database to dreamweaver in Mac OS 10.4.8 and
I kept getting:

"Can't connect to MySQL server through socket '/var/mysql/mysql.sock' ERROR#:
2002".

After a lot of searching I came across
http://www.yqcomputer.com/
there was an error in the PHP and MySQL connection or something.

Anyway all I had to do was type (in a TERMINAL window):

$ sudo mkdir /var/mysql
$ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

and that fixed the problem, otherwise the adobe article worked very well.
Check out the "this article" link to get the fix straight from the horse's
mouth.