我的德鲁什·多恩';t运行数据库命令(apache)
我已经在我的Mac(El Capitan)上用apache设置了虚拟主机。我的所有项目都位于我的用户/MyName/Sites中,我安装了Drush。我可以使用drush下载stuf,比如:drushdl-drupal。但当我尝试使用drush启用模块时,我得到了以下结果:我的德鲁什·多恩';t运行数据库命令(apache),apache,drupal,osx-elcapitan,drush,Apache,Drupal,Osx Elcapitan,Drush,我已经在我的Mac(El Capitan)上用apache设置了虚拟主机。我的所有项目都位于我的用户/MyName/Sites中,我安装了Drush。我可以使用drush下载stuf,比如:drushdl-drupal。但当我尝试使用drush启用模块时,我得到了以下结果: Command pm-enable needs a higher bootstrap level to run - you will [error] need to invoke drush from a more func
Command pm-enable needs a higher bootstrap level to run - you will [error]
need to invoke drush from a more functional Drupal environment to run
this command.
The drush command 'en admin_toolbar' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a
configured database. In this case you can select another site with a
working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for
details.
* connect the database through a socket. The socket file may be
wrong or the php-cli may have no access to it in a jailed shell. See
http://drupal.org/node/1428638 for details.
Drush was attempting to connect to:
Drupal version : 7.41
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database port :
Database username : root
Database name : MyDatabase
PHP executable : /usr/bin/php
PHP configuration :
PHP OS : Darwin
Drush script : /Users/kim/.composer/vendor/drush/drush/drush.php
Drush version : 8.1-dev
Drush temp directory : /tmp
Drush configuration :
Drush alias files :
Drupal root : /Users/MyName/Sites/MyProject
Site path : sites/default
我的问题是我的drush没有正确配置到数据库设置,但我不知道如何解决这个问题,或者这是否是真正的问题。如果有人能帮助我,那就太好了 我最近也犯了类似的错误。事实证明,我需要将mysql添加到系统路径中,这是通过将下面的行添加到我的.bash_配置文件中实现的。我正在使用MAMP,因此您可能需要调整设置的路径
export PATH=$PATH:/Applications/MAMP/Library/bin/自己修复了它,对于apache,.bash_配置文件中的路径是
export PATH="/usr/local/mysql/bin:$PATH"
我以前也运行MAMP,但现在我只使用apache。我需要定义另一个路径,但我不知道哪一个…Drush设置有问题。试试这个: