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

Miroslav Lachman 000.fbsd at quip.cz
Sun Feb 18 22:19:21 UTC 2007


Rajen Jani (BT Yahoo! Broadband) wrote:
> Hi  everyone,
> 
>           I have installed mySQL server 5.0.27 from the ports directory.
> Everytime I connect to it using
> "mysql -h localhost -u rajen -p" I get the above error. I have no idea
> as to how I can resolve this
> problem. I have tried telneting localhost and it says that the
> connection is refused. Please suggest
> how I can get around this, Thanks.

Is MySQL daemon runnig? What is output of command:
ps -auxwww | grep mysqld

and output of

ls -al /tmp/mysql.sock

Can you connect to MySQL from other software, or by mysql -h 127.0.0.1 
-u rajen -p ?

Miroslav Lachman


More information about the freebsd-database mailing list