"Drush cannot find your database connection details" I'm having an issue that is baffling to me as a new user and I'm hoping someone here can answer me how to fix the error.  I'm trying to clone an existing drupal installation into a place on my mac with the commands

echo "Pushing private files"
/usr/local/bin/drush core-rsync @hpc.dev:%private @hpc.local:%private
echo "Pushing webroot files"
/usr/local/bin/drush -y core-rsync @hpc.dev @hpc.local
echo "Pushing database"
/usr/local/bin/drush -y sql-sync --no-cache @hpc.dev @hpc.local
echo "Clearing Drupal cache"
/usr/local/bin/drush -y @hpc.local cc all


This works fine until with the sql-sync piece, where I get the error: 

... stuff stuff stuff
Command dispatch complete                                                             [notice]
Copying dump file from Source to Destination.                                      [ok]
Starting to import dump file onto Destination database.                            [ok]
/usr/bin/php /usr/local/drush-master/drush.php --php=/usr/bin/php  --backend=2        [notice]
--verbose --yes --strict=0 --root=/Users/cook47/Sites/drupal-test/html
--uri='http://localhost/~cook47/drupal-test'  sql-query  
--file=/tmp/hpc-drupal-dev_20160302_005939.sql.gz --file-delete 2&gt;&amp;1
exception 'Drush\Sql\SqlException' with message 'Unable to find a matching SQL     [error]
Class. Drush cannot find your database connection details.' in
/usr/local/drush-master/commands/sql/sql.drush.inc:591
Stack trace:
#0 /usr/local/drush-master/commands/sql/sql.drush.inc(419):
drush_sql_get_class(NULL)
#1 [internal function]: drush_sql_query()
#2 /usr/local/drush-master/includes/command.inc(366):
call_user_func_array('drush_sql_query', Array)
#3 /usr/local/drush-master/includes/command.inc(217): _drush_invoke_hooks(Array,
Array)
#4 [internal function]: drush_command()
#5 /usr/local/drush-master/includes/command.inc(185):
call_user_func_array('drush_command', Array)
#6 /usr/local/drush-master/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#7 /usr/local/drush-master/includes/preflight.inc(66):
Drush\Boot\BaseBoot-&gt;bootstrap_and_dispatch()
#8 /usr/local/drush-master/drush.php(12): drush_main()
#9 {main}


Something appears to be awry with my database on the localhost or perhaps with my alias.

Here is my alias for localhost: 

$aliases['local'] = array (
  'root' =&gt; '/Users/cook47/Sites/drupal-test/html', //CHANGEME
  'uri' =&gt; 'http://localhost/~cook47/drupal-test', //CHANGEME
  //'remote-host' =&gt; "localhost",
  //'remote-user' =&gt; 'cook47',
  'path-aliases' =&gt; array (
    '%drush' =&gt; '/usr/local/bin/drush', //CHANGEME
    '%site' =&gt; 'sites/default/',
    '%files' =&gt; 'sites/default/files',
    '%private' =&gt; '../private',
    '%dump' =&gt; '/export/www/hpc-drupal-dev.llnl.gov/drush-dump.sql',//CHANGEME
  ),
  'target-command-specific' =&gt; array(
    'sql-sync' =&gt; array(//CHANGEME
      'enable' =&gt; array('devel'),
      'disable' =&gt; array(
      ),
    ),
  ),
  'command-specific' =&gt; array(
    'rsync' =&gt; array(
      'mode' =&gt; 'vrlzOk',
      'exclude-conf' =&gt; 1,
    ),
  ),
  'databases' =&gt; array (
    'default' =&gt; array (
      'default' =&gt; array (
        'database' =&gt; 'hpc-drupal-dev', //CHANGEME
        'username' =&gt; 'hpc-drupal-dev', //CHANGEME
        'password' =&gt; 'xxxxxx', //CHANGEME
        'host' =&gt; 'localhost',
        'port' =&gt; '',
        'driver' =&gt; 'mysql',
        'prefix' =&gt; '',
      ),
    ),
  ),
);
Drush no longer allows you to define a 'database' record in your site alias file for use with sql-sync.  This used to work in earlier versions, but is no longer supported.  Make sure that the source and target sites both have valid settings.php files that include the database information.

To test:

drush @hpc.dev sql-conf


If your database connection is correct, it will be displayed. Using sql-conf on each site can help isolate which one is having a problem with its connection info.