How to 'drush sql-dump' all databases I have two databases I connect to with drupal. Does drush sql-dump back up all databases defined in settings.php?

If not how can I create dumps of both databases?

I've attempted using the --database=db_to_backup option but it throws an error:

sh: 1: Syntax error: "&amp;&amp;" unexpected
Database dump failed 


Many thanks
If your database connection on settings.php looks like

$databases = array(
  'default' =&gt;
  array(
    'default' =&gt;
    array(
      'database' =&gt; 'mydatabase1',
      'username' =&gt; 'root',
      'password' =&gt; 'root',
      'host' =&gt; 'localhost',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
    ),
  ),
  'test' =&gt;
  array(
    'default' =&gt;
    array(
      'database' =&gt; 'mydatabase2',
      'username' =&gt; 'root',
      'password' =&gt; 'root',
      'host' =&gt; 'localhost',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
    ),
  ),
);


The following command will back up both the data bases;

drush sql-dump --database=default --result-file=default.sql; drush sql-dump --database=test --result-file=test.sql