Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running drush sql-cli or sql-drop using --target fails in Drupal 8 #2137

Closed
generalredneck opened this issue Apr 18, 2016 · 4 comments
Closed
Labels

Comments

@generalredneck
Copy link

generalredneck commented Apr 18, 2016

my settings.php has the following:

<?php
/**
 * @file
 * Secret configuration settings for the site.
 */

$databases = array(
  'default' => array(
    'default' => array(
      'database' => 'drupal',
      'username' => 'drupal',
      'password' => 'drupal',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
  'migrate' => array(
    'default' => array(
      'database' => 'upgrade',
      'username' => 'drupal',
      'password' => 'drupal',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

In this case doing drush sql-drop --target=default -y works. However doing drush sql-drop --target=migrate provides me with an exception

exception 'Drush\Sql\SqlException' with message 'Unable to find a matching SQL Class. Drush cannot    [error]
find your database connection details.' in
/var/www/html/build/vendor/drush/drush/commands/sql/sql.drush.inc:593
Stack trace:
#0 /var/www/html/build/vendor/drush/drush/commands/sql/sql.drush.inc(436): drush_sql_get_class()
#1 [internal function]: drush_sql_drop()
#2 /var/www/html/build/vendor/drush/drush/includes/command.inc(366):
call_user_func_array('drush_sql_drop', Array)
#3 /var/www/html/build/vendor/drush/drush/includes/command.inc(217): _drush_invoke_hooks(Array,
Array)
#4 [internal function]: drush_command()
#5 /var/www/html/build/vendor/drush/drush/includes/command.inc(185):
call_user_func_array('drush_command', Array)
#6 /var/www/html/build/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#7 /var/www/html/build/vendor/drush/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#8 /var/www/html/build/vendor/drush/drush/drush.php(12): drush_main()
#9 {main}

the "upgrade" database does exist and the credentials are correct.

@weitzman
Copy link
Member

Can't reproduce the problem with sql-drop using a non-default --target. Working fine here.

@generalredneck
Copy link
Author

generalredneck commented Apr 19, 2016

@weitzman real quick... I know I forgot to add my drush version. I'm using 8.0.5. are we testing on the same version. If not, let me test on the version you are on.

@weitzman
Copy link
Member

I'm using master branch. If installing via composer, use 'dev-master' version

@generalredneck
Copy link
Author

n/m... this was the biggest case of idiot...

bitmoji

so if you take a look at my connection string and map it to flags... I should be using --database, not --target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants