Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


hi there
i have set up a database and it all seems correct, i have more databases up and they work fine its just this one, and i get this error:

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

has anyone else had this?

heres the link

trying to set up “koolphp”

thank you


You probably left the “hostname” field blank. Fill it in with your MySQL hostname (probably and try again.


hi there
no its filled in ie:

very strange?
is there anyway you could have a look



Are you able to log into your database via DH panel --> Goodies --> MySQL Databases?


hi there

yes of course!!! i logged on to DH panel --> Goodies --> MySQL Databases.

thats were i create the host and upload my databases


I’m having the same problem: i use the DH Web Panel -> Toolbox -> MySQL Databases to make a new database. i can see several entries in the Hostname list. When I go to connect to the new DB, i get :
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

This happens no matter which hostname I use. Btw, this is the error i get when trying to connect using “mysql” in an SSH session with my DH account.

Anyone find a solution to this?


The error message you’re getting indicates that the MySQL hostname isn’t set correctly. You’re putting the hostname where the name of the database belongs.



This is my first post here. I had the same problem and have contacted my hosting account. They resolved it. But took about 18 hours to resolve the issue. Hope this helps.