Error: Class 'Drush\Sql\Sql' not found This is my first attempt at installing Drupal using Composer. I have successfully installed Composer and the Drupal Project template, which comes configured with Drush. To install I use

composer create-project drupal-composer/drupal-project:~8.0 {dir} --stability dev --no-interaction


Next, when I try to install Drupal using Drush with

../vendor/bin/drush site-install --db-url=mysql://{username}:{password}@localhost/{database}


I receive this error

Error: Class 'Drush\Sql\Sql' not found in /Users/.../vendor/drush/drush/src/Sql/SqlBase.php on line 81


I have installed Drush and Composer locally. I have tried requiring drush again after the composer install. I have tried using Drush 9.2.3. SO, If I go through the manual install of Drupal, Drush init does run, but any other command other than version gives me

In Connection.php line 149:
SQLSTATE[HY000] [2002] No such file or directory


I'm using:


Composer 1.6.5
Drush 9.3
Drupal 8.4.5
Does your password contain a #? Try this test:

&lt;?php

function test_url($url) {
    $message = (parse_url($url) === false)?"parse_url unable to parse url: 
{$url}\n":print_r(parse_url($url),true);
    echo  $message;
}

test_url("mysql://user:password@site/database_name");
test_url("mysql://user:C0mPl3XP4ss@site/database_name");
test_url("mysql://user:Ci)(*$!@@site/database_name");
test_url("mysql://user:pass#word@site/database_name");
?&gt;


The last URL example fails to be parsed. This appears to be coming from 

vendor/drush/drush/src/Sql/SqlBase.php:dbSpecFromDbUrl().


I hit the same issue and traced it to a '#' in my MySQL user password. Changed the password to remove the '#' and everything is working.