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?

Thanks!!

  • Is the MySQL service running? MySQL port is correct? Did you create the MySQL account that has the appropriate permissions to the database? – user785179 Oct 10 '12 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! – everaftergraphics Oct 10 '12 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! – everaftergraphics Oct 11 '12 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 Oct 11 '12 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. – Eduard Luca Nov 2 '12 at 2:02
up vote 0 down vote accepted

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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