Drush enable error

别来无恙 提交于 2020-01-17 12:25:10

问题


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]

回答1:


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



回答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.



来源:https://stackoverflow.com/questions/29260311/drush-enable-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!