当我使用drush启用模块时我得到了这个错误
我使用mamp pro 3和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]
答案 0 :(得分:2)
我唯一一次看到这是因为我在Drupal配置中将数据库的主机名设置为&#39; localhost&#39;。出于某种原因,在某些情况下,它会查找本地套接字而不是网络套接字。查看您的配置,如果数据库主机设置为localhost,请尝试将其更改为127.0.0.1。
答案 1 :(得分:0)
我遇到了同样的问题,经过四处寻找我发现te sock文件是:
/private/tmp/mysql.sock
不
/var/mysql/mysql.sock
在这种情况下,我做了:
cd /var
sudo mkdir mysql
cd mysql
sudo ln -s /private/tmp/mysql.sock mysql.sock