Has anyone come across this problem? Once I get drupal all ready to install on my localhost I go to the URL and start going through the installation process and when it comes to my database it fails.

So I import the site into Acquia Dev Desktop, create the database, and then go to the URL, select the type of installation and then when I come to the database information page it fails.

Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).

I can't find any helpful documentation on this issue. Can anyone help?


  • Is the MySQL service running? MySQL port is correct? Did you create the MySQL account that has the appropriate permissions to the database?
    – user785179
    Commented Oct 10, 2012 at 21:08
  • Yes, SQL is running through the Acquia Dev Desktop, I double checked the port is correct, and I logged into PHPmyAdmin and double checked the username and password on the database created... I'm stumped!! I'll double check all those things again as soon as I get home, just in case I wasn't seeing things right this morning! Commented Oct 10, 2012 at 22:48
  • Yeah - I double checked everything - I'm running phpMyAdmin side by side with my Drupal and no go. I've created a new database user with full permissions - no go. added in the MySQL port number - no go... ??? Any ideas? I'm slowly going crazy! Commented Oct 11, 2012 at 0:17
  • You sure the username and password is correct? Is the DB host set correctly (e.g. IP address, localhost, FQDN)? Are you sure the database name is correct? It's just too difficult to narrow down without asking all these questions and investigating further.
    – user785179
    Commented Oct 11, 2012 at 20:12
  • It's not a problem of user/pass/db name. Open the config file of MySQL (my.cnf), and make sure socket = /tmp/mysql.sock is listed under the [mysqld] tag. Alternatively you could try to connect to your MySQL from terminal/CMD and see if that works. If not, it's clearly a MySQL problem. If I'm not mistaken, phpMyAdmin can work even if the above line is not in your config. Commented Nov 2, 2012 at 2:02

2 Answers 2


Thanks for the responses everyone. I ended up getting so frustrated I uninstalled Aquia Dev Desktop and then re-installed a newer version of it. It seems to have solved the problem because I haven't run into this issue since.


We're having this same problem with Dev Desktop 2 beta. In the my.cnf that comes with dev desktop, the socket line is as follows...

[mysql] socket="/Applications/Dev Desktop/mysql/data/mysql.sock"

Which one is correct? The one Drupal is trying to use, or the one dev desktop is trying to assign?

We tried adding a line under [mysqld] for socket = /tmp/mysql.sock but nothing changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.