Drush 8 database connection issue I'm having trouble connecting to my databases. It worked a few days ago but can't seem to figure why it doesn't work now. It's a D8-site. Drush version is 8.1.12.

I've double-checked both the alias-file and settings.php-files (both on server &amp; local) and database settings all appear correct. My local site runs on Mamp 4.1.1. and network access is allowed.

Here's the error I get when running sql-sync drush sql-sync @local @dev. Rsync works fine.

Unable to load class Drush\Sql\Sql                                                                                                                                                                                                                                 [error]
exception 'Drush\Sql\SqlException' with message 'Unable to find a matching SQL Class. Drush cannot find your database connection details.' in /vendor/drush/drush/commands/sql/sql.drush.inc:541                [error]
Stack trace:
#0 /vendor/drush/drush/commands/sql/sql.drush.inc(252): drush_sql_get_class()
#1 [internal function]: drush_sql_dump()
#2 /vendor/drush/drush/includes/command.inc(422): call_user_func_array('drush_sql_dump', Array)
#3 /vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#4 [internal function]: drush_command()
#5 /vendor/drush/drush/includes/command.inc(199): call_user_func_array('drush_command', Array)
#6 /vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#7 /vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot-&gt;bootstrap_and_dispatch()
#8 /vendor/drush/drush/drush.php(12): drush_main()
#9 {main}
sql-dump failed.


And here's the aliases.drushrc.php (my local copy of course includes credentials:))

&lt;?php

/* Tambourhinoceros Site */

$aliases["local"] = array (
 'root' =&gt; '', // local path
 'uri' =&gt; 'local.tambourhinoceros.net',  // local uri
 'path-aliases' =&gt;
 array (
   '%dump-dir' =&gt; '/tmp',
   '%drush' =&gt; '/usr/local/bin',
   '%site' =&gt; 'sites/default',
 ),
 'remote-user' =&gt; 'tamb_dev', 
 'ssh-options' =&gt; '-T',
 'databases' =&gt;
 array (
   'default' =&gt;
   array (
     'default' =&gt;
     array (
        'database' =&gt; '', // local database 
        'username' =&gt; '', // local database user
        'password' =&gt; '', // local database pw
        'host' =&gt; 'localhost',
        'port' =&gt; '8889',
        'namespace' =&gt; 'Drupal\\Core\\Database\\Driver\\mysql',
        'driver' =&gt; 'mysql',
        'prefix' =&gt; '',
      ),
    ),
  ),
);

$aliases["dev"] = array (
  'root' =&gt; '', // remote path
  'uri' =&gt; 'drupal-85630-297475.cloudwaysapps.com', // remote uri
  'path-aliases' =&gt;
  array (
  ),
  'remote-host' =&gt; '', remote IP
  'remote-user' =&gt; '', remote User
  'command-specific' =&gt;
 array (
   'rsync' =&gt;
   array (
     'mode' =&gt; 'rlptzO',
     'verbose' =&gt; true,
     'no-perms' =&gt; true,
   ),
 ),
 'databases' =&gt;
 array (
   'default' =&gt;
   array (
     'default' =&gt;
     array (
        'database' =&gt; '', remote database
        'username' =&gt; '', remote  user
        'password' =&gt; '', remote pw
        'host' =&gt; 'localhost',
        'port' =&gt; '',
        'driver' =&gt; 'mysql',
        'prefix' =&gt; '',
      ),
    ),
  ),
)
?&gt;
It will be Solved by adding

--root=/full/path/to/your/webroot


to the drush command.