首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Drush不能引导

Drush不能引导
EN

Drupal用户
提问于 2014-05-24 15:31:57
回答 2查看 13.4K关注 0票数 6

我使用Composer安装Drush 7,并在Windows上的XAMPP上创建了一个Drupal 8。

  1. H:\xampp\htdocs\d8_test是Drupal根。
  2. H:\xampp\htdocs\d8_test\sites\default\settings.php.是settings.php文件的位置

所有的drush命令都没有工作。所有的失败都有相同的错误:

代码语言:javascript
复制
H:\xampp\htdocs\d8_test>drush pmi
Command pm-info needs a higher bootstrap level to run - you will need    [error]

to invoke drush from a more functional Drupal environment to run this
command.
The drush command 'pmi' 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        :  8.0-dev
 Site URI              :  http://default
 Database driver       :  mysql
 Database username     :  root
 Database name         :  d8_test
 PHP executable        :  php.exe
 PHP configuration     :  H:\xampp\php\php.ini
 PHP OS                :  WINNT
 Drush version         :  7.0-dev
 Drush temp            :  Z:\Temp
 directory
 Drush configuration   :
 Drush alias files     :
 Drupal root           :  H:/xampp/htdocs/d8_test
 Site path             :  sites/default
 Active config path    :  sites/default/files/config_MoeSD5C7JSguok
                          xrBh4-UuwT_r9_jk2Z59QKdN-j9Zx9DIgHBy2dH8n
                          1rGOeKNJpaAAxBi4PzA/active
 Staging config path   :  sites/default/files/config_MoeSD5C7JSguok
                          xrBh4-UuwT_r9_jk2Z59QKdN-j9Zx9DIgHBy2dH8n
                          1rGOeKNJpaAAxBi4PzA/staging

我的settings.php的内容

代码语言:javascript
复制
$databases['default']['default'] = array (
  'database' => 'd8_test',
  'username' => 'root',
  'password' => '',
  'prefix' => '',
  'host' => '127.0.0.1',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

注意,我的MySQL安装主机是127.0.0.1,而不是localhost。

还请注意,H:\xampp\php\被添加到我的PATH变量中,因此php.exe引用了H:\xampp\php\php.exe。

drush sql-connect的输出如下:

mysql --用户=root--密码=--数据库=d8_test--主机=127.0.0.1--端口=3306

EN

回答 2

Drupal用户

回答已采纳

发布于 2014-05-24 22:15:26

drush sql-connect的输出为mysql --user=root --password= --database=d8_test --host=127.0.0.1 --port=3306。现在,当我直接执行这个命令时,它没有工作,因为系统路径中没有mysql.exe。因此,我将H:\xampp\mysql\bin添加到PATH (Windows中的环境变量),然后它就起作用了!

票数 21
EN

Drupal用户

发布于 2014-08-02 03:05:23

确保安装了mysql客户端核心-5.5包。

关于Ubuntu:

代码语言:javascript
复制
sudo apt-get install mysql-client-core-5.5
票数 5
EN
页面原文内容由Drupal提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://drupal.stackexchange.com/questions/115158

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档