0

when i what to enable module using drush I'm getting this error

Im using mamp pro 3 and php 5.5.10

<h1>Additional uncaught exception thrown while handling exception.</h1
<h2>Original</h2>
<p>PDOException: SQLSTATE[HY000] [2002] Socket operation on non-socket 
in drupal_is_denied() (line 1933 of /Users/edinpuzic/desktop/projekti/studiotnt
/includes/bootstrap.inc).</p>
<h2>Additional</h2>
<p>PDOException: SQLSTATE[HY000] [2002] Socket operation on non-socket 
in _registry_check_code() (line 3185 of /Users/edinpuzic/desktop/projekti/studiotnt
/includes/bootstrap.inc).</p>
<hr />Drush command terminated abnormally due to an unrecoverable error.   [error]
Edin Puzic
  • 998
  • 2
  • 19
  • 39

2 Answers2

2

The only time I've seen this is when I set hostname for the database in the Drupal config to 'localhost'. For some reason, in some situations, it looks for a local socket instead of a network socket. Look at your config and if the database host is set to localhost, try changing it to 127.0.0.1.

Muhammad Reda
  • 26,379
  • 14
  • 93
  • 105
Quint
  • 776
  • 4
  • 11
0

I had the same issue, after poking around I've figured out that te sock files was:

/private/tmp/mysql.sock

not

/var/mysql/mysql.sock

In this case I did:

cd /var
sudo mkdir mysql 
cd mysql
sudo ln -s /private/tmp/mysql.sock mysql.sock
Wils
  • 1,211
  • 17
  • 31