0

When I start drush en name_of_module in terminal i get this error

Im using mamp and 5.3.27 php version

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.34
Site URI : http://default
Database driver : mysql
Database username : root
Database name : ceo
Default theme : garland
Administration theme : garland
PHP executable : /usr/bin/php
PHP configuration :
PHP OS : Darwin
Drush version : 6.5.0
Drush configuration :
Drush alias files :
Drupal root : /Users/edinpuzic/Desktop/Projekti/CEO/cm s
Site path : sites/default
File directory path : sites/default/files

Edin Puzic
  • 998
  • 2
  • 19
  • 39
  • Are you in the same folder as your settings.php file when you run this? – chadpeppers Mar 20 '15 at 17:38
  • I'm in root folder of drupal site. My settings.php looks like this: $databases = array ( 'default' => array ( 'default' => array ( 'database' => 'ceo', 'username' => 'root', 'password' => 'password', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '', ), ), ); – Edin Puzic Mar 20 '15 at 17:41
  • You need to execute your drush command from your folder with the settings.php file – chadpeppers Mar 20 '15 at 18:03
  • I try, same error :( – Edin Puzic Mar 20 '15 at 18:12
  • You do not need to be in the folder where settings.php is located. You need to specifiy the website url. – DirkR Mar 23 '15 at 07:48

1 Answers1

0

I just copied the answer to another/similar question I answered recently. drush says in your snippet above, that it asumes the site URI http://default. I'm sure that's not correct? Drush needs some context to know where to get your installation (install folder and database). It knows the installation root, but not the URL (to select the correct sites/folder/).

You might want to use the option --rootto specify the webroot of your drupal installation. You can also specify the website URL using the option --uri, if you have a multisite installation. Look at http://docs.drush.org/en/master/usage/#options for an in-depth description.

But the best way to handle you setup is drush aliases (http://docs.drush.org/en/master/usage/#site-aliases). You define an alias @site1 etc. and this alias references the webroot and site URL (and optionally other parameters as well).

DirkR
  • 344
  • 1
  • 5