0

I have created a drupal project using composer:

composer create-project drupal-composer/drupal-project:8.x-dev ./ --stability dev -vv

Then I downloaded drush using this command:

composer global require drush/drush

Now I try to install the drupal site using this drush command:

drush si standard --db-url=mysql://***:***@localhost/recommande_db --site-name=***** --account-name=*** --account-pass=*** --account-mail=*****

I'm getting this error:

exception 'Drush\Sql\SqlException' with message 'Unable to find a matching SQL Class. Drush cannot find your[error]

database connection details.' in

/Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/commands/sql/sql.drush.inc:588

Stack trace:

#0 /Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/commands/sql/sql.drush.inc(573):

drush_sql_get_class(Array)

#1

/Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/commands/core/site_install.drush.inc(117):

drush_sql_get_class()

#2 [internal function]: drush_core_pre_site_install('standard')

#3 /Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/includes/command.inc(366):

call_user_func_array('drush_core_pre_...', Array)

#4 /Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/includes/command.inc(217):

_drush_invoke_hooks(Array, Array)

#5 [internal function]: drush_command('standard')

#6 /Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/includes/command.inc(185):

call_user_func_array('drush_command', Array)

#7 /Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67):

drush_dispatch(Array)

#8 /Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/includes/preflight.inc(66):

Drush\Boot\BaseBoot->bootstrap_and_dispatch()

#9 /Applications/MAMP/htdocs/dev.recommandemoi.ma/vendor/drush/drush/drush.php(12): drush_main()

#10 {main}

I tried all the suggestions found in several forum but no solution. Can you help please!

For your information here the result of the "drush status" command:

PHP executable         :  /usr/bin/php                                         

 PHP configuration      :                                                       

 PHP OS                 :  Darwin                                               

 Drush script           :  /Applications/MAMP/htdocs/dev.recommandemoi.ma/vendo 

                           r/drush/drush/drush.php                              

 Drush version          :  8.1.2                                                

 Drush temp directory   :  /tmp                                                 

 Drush configuration    :                                                       

 Drush alias files      : 
  • Make sure you have php_mysql installed (e.g. dpkg -l | grep php on ubuntu) – Clive Jul 21 '16 at 15:23
  • both php and mysql are installed. I'm using mac os and the php already installed in the os. I'm also using mysql of phpmyadmin – Asy Jul 21 '16 at 15:33
1

Make sure that you execute drush from the web folder.

  • I would prefer saying "within the Drupal folder" – Jimmy Ko Jul 21 '16 at 16:47
  • yes it's the "web" folder in my case since I've created with composer create – Asy Jul 21 '16 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.