0

Just started with drupal and drush CLI but having problems already!
Here is my error:

$ drush si --debug --db-url =mysql://USERNAME:PASSWORD@HOST/DATABASE/drushfun   
Starting Drush preflight. [0 sec, 1.29 MB]                                                                                                                                                      [preflight]
Cache HIT cid: 7.1.0-commandfiles-0-33a837c10472909bafe9ab29823ddb79 [0.01 sec, 1.32 MB]                                                                                                              [debug]
Bootstrap to phase 0. [0.06 sec, 3.52 MB]                                                                                                                                                         [bootstrap]
Bootstrap to phase 1. [0.06 sec, 3.52 MB]                                                                                                                                                         [bootstrap]
Drush bootstrap phase : bootstrap_drupal_root() [0.06 sec, 3.73 MB]                                                                                                                               [bootstrap]
Initialized Drupal 7.41 root directory at /home/USER/Documents//drupal-7.41fun [0.06 sec, 3.73 MB]                                                                           [notice]
Find command files for phase 1 (max=1) [0.07 sec, 2.71 MB]                                                                                                                                            [debug]
Cache HIT cid: 7.1.0-commandfiles-1-b9de3821d4a21c5d43292e8f9d7ffd3d [0.07 sec, 2.71 MB]                                                                                                              [debug]
Found command: site-install (commandfile=site_install) [0.07 sec, 2.71 MB]                                                                                                                        [bootstrap]
Calling hook drush_core_site_install_validate [0.09 sec, 3.75 MB]                                                                                                                                     [debug]
Returned from hook drush_core_site_install_validate [0.09 sec, 3.75 MB]                                                                                                                               [debug]
Calling hook drush_core_pre_site_install [0.09 sec, 3.76 MB]                                                                                                                                          [debug]
exception 'Drush\Sql\SqlException' with message 'Unable to find a matching SQL Class. Drush cannot find your database connection details.' in                                                     [error]
/home/USER/.composer/vendor/drush/drush/commands/sql/sql.drush.inc:597
Stack trace:
#0 /home/USER/.composer/vendor/drush/drush/commands/sql/sql.drush.inc(582): drush_sql_get_class(Array)
#1 /home/USER/.composer/vendor/drush/drush/commands/core/site_install.drush.inc(107): drush_sql_get_class()
#2 [internal function]: drush_core_pre_site_install('=mysql://root:r...')
#3 /home/USER/.composer/vendor/drush/drush/includes/command.inc(359): call_user_func_array('drush_core_pre_...', Array)
#4 /home/USER/.composer/vendor/drush/drush/includes/command.inc(210): _drush_invoke_hooks(Array, Array)
#5 [internal function]: drush_command('=mysql://root:r...')
#6 /home/USER/.composer/vendor/drush/drush/includes/command.inc(178): call_user_func_array('drush_command', Array)
#7 /home/USER/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(62): drush_dispatch(Array)
#8 /home/USER/.composer/vendor/drush/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#9 /home/USER/.composer/vendor/drush/drush/drush.php(11): drush_main()
#10 {main} [0.09 sec, 3.78 MB]
Command dispatch complete [0.09 sec, 3.75 MB]                                                                                                                                                        [notice]
$    

Here is what i have so far:

$ drush status
Drupal version         :  7.41                                                         
Site URI               :  http://default                                               
PHP executable         :  /usr/bin/php                                                 
PHP configuration      :  /etc/php5/cli/php.ini                                        
PHP OS                 :  Linux                                                        
Drush script           :  /home/USER/.composer/vendor/drush/drush/drush.php           
Drush version          :  7.1.0                                                        
Drush temp directory   :  /tmp                                                         
Drush configuration    :                                                               
Drush alias files      :                                                               
Drupal root            :  /home/USER/Documents/drupal-7.41fun 
Site path              :   sites/default                                                

Why do i have that error? Am i missing something? Need to be able to work from the CLI.

$ php -v
PHP 5.6.17-1+deb.sury.org~precise+1 (cli) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies 

$ mysql --version
mysql  Ver 14.14 Distrib 5.5.46, for debian-linux-gnu (i686) using readline 6.2      

mysql> SELECT VERSION();
+-------------------------+
| VERSION()               |
+-------------------------+
| 5.5.46-0ubuntu0.12.04.2 |
+-------------------------+
0
2

Drush options are space separated, so this:

drush si --debug --db-url =mysql://USERNAME:PASSWORD@HOST/DATABASE/drushfun   

Just needs to be:

drush si --debug --db-url=mysql://USERNAME:PASSWORD@HOST/DATABASE/drushfun   

(no space between --db-url and =)

1
  • 2
    Thanks it error is gone but i can't see DB info when i do a drush status. I see the same as above. – mamesaye Jan 11 '16 at 18:05

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.