0

I was running a successful (drupal) site using Mysql (I'm on Mac OS X) until I suddenly started to get the following error: "PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in db_table_exists()"

I don't know what this means or how to fix it, but when I visit phpmyadmin I get the following message: "#2013 - Lost connection to MySQL server at 'reading initial communication packet', system error: 61"

@Mitch: I installed it using the acquia drupal dev desktop stack, although I also have MAMP installed. I tried restarting the servers using these programs and this is the error I got (above). Can you perhaps provide more detailed instructions? Thanks.

3 Answers 3

1

It means your database is off (or crashing). You need to restart it. This will vary depending on how you installed MySQL.

Sign up to request clarification or add additional context in comments.

Comments

1

You probably need to comment out the bind address in my.conf.

edit: no, seriously.

Comments

0

SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock'

means MySQL can't be connected through the socket file.

Check if /tmp/mysql.sock is present (including permissions), if not check your my.cnf where it is (or run mysql_config --socket).

So you can either make a symbolic link or alternatively specify unix_socket path in your settings.php file ('unix_socket' => '/tmp/mysql.sock',).

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.