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
  • 1
    The message Class 'Drush\Sql\Sql' not found indicates that the Drush doesn't understand which driver to use. (Your site-install command looks correct.) Drush is supposed to load the class Drush\Sql\Sql<Driver> - for example Drush\Sql\SqlMysql. Maybe you could run the command with debugging using the "-d" otpion?
    – hansfn
    Commented Jun 20, 2018 at 7:51

2 Answers 2


Does your password contain a #? Try this test:


function test_url($url) {
    $message = (parse_url($url) === false)?"parse_url unable to parse url: 
    echo  $message;


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


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.

  • I had the same 'Drush\Sql\Sql' not found problem, and I had a special character in my mysql password, although it wasn't #. In my case it was &, and it passed your test_url. But still when I changed the password to one without special characters the drush site-install went through.
    – prkos
    Commented Sep 3, 2018 at 23:54

I had a similar issue on Windows 10. I didn't notice where the issue was coming from at first because I had Drush installed both globally and locally. After uninstalling drush globally, I noticed drush was not found anymore. After adding my local drush to my PATH I finally managed to launch the site install command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.