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>&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->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' => '/Users/cook47/Sites/drupal-test/html', //CHANGEME
'uri' => 'http://localhost/~cook47/drupal-test', //CHANGEME
//'remote-host' => "localhost",
//'remote-user' => 'cook47',
'path-aliases' => array (
'%drush' => '/usr/local/bin/drush', //CHANGEME
'%site' => 'sites/default/',
'%files' => 'sites/default/files',
'%private' => '../private',
'%dump' => '/export/www/hpc-drupal-dev.llnl.gov/drush-dump.sql',//CHANGEME
),
'target-command-specific' => array(
'sql-sync' => array(//CHANGEME
'enable' => array('devel'),
'disable' => array(
),
),
),
'command-specific' => array(
'rsync' => array(
'mode' => 'vrlzOk',
'exclude-conf' => 1,
),
),
'databases' => array (
'default' => array (
'default' => array (
'database' => 'hpc-drupal-dev', //CHANGEME
'username' => 'hpc-drupal-dev', //CHANGEME
'password' => 'xxxxxx', //CHANGEME
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
),
);