1

I am having difficulties installing a d7 drupal site using Drush. The files downloaded fine using Drush. From within the renamed folder for the drush install I type

Pauls-iMac:drush-test Trotter$ drush site-install standard --db-url='mysql://superadmin:password@localhost/drush-test' --site-name=Example

I then get the message below. I can see from phpmyadmin that the database has been created ok, but has no tables in it.

You are about to CREATE  the 'drush-test' database. Do you want to continue? (y/n): y
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'superadmin'@'localhost' (using password: YES)
Starting Drupal installation. This takes a few seconds ...                   [ok]
WD php: Exception: Resolve all issues below to continue the installation. For[error]
help configuring your database server, see the installation handbook, or
contact your hosting provider.Failed to connect to your database server. The
server reports the following message: SQLSTATE[HY000] [2002] No such file or
directory.Is the database server running?Does the database exist, and have
you entered the correct database name?Have you entered the correct username
and password?Have you entered the correct database hostname? in
install_run_task() (line 414 of
/applications/xampp/xamppfiles/htdocs/drush-test/includes/install.core.inc).
WD php: Warning: Cannot modify header information - headers already sent by  [warning]
(output started at
/Users/Trotter/.composer/vendor/drush/drush/includes/output.inc:38) in
drupal_send_headers() (line 1233 of
/applications/xampp/xamppfiles/htdocs/drush-test/includes/bootstrap.inc).
Exception: Resolve all issues below to continue the installation. For help configuring your database server, see the <a href="http://drupal.org/getting-started/install">installation handbook</a>, or contact your hosting provider.<p class="error">Failed to connect to your database server. The server reports the following message: <em>SQLSTATE[HY000] [2002] No such file or directory</em>.<ul><li>Is the database server running?</li><li>Does the database exist, and have you entered the correct database name?</li><li>Have you entered the correct username and password?</li><li>Have you entered the correct database hostname?</li></ul></p> in install_run_task() (line 414 of /applications/xampp/xamppfiles/htdocs/drush-test/includes/install.core.inc).
Drush command terminated abnormally due to an unrecoverable error.           [error]

I am confused as to why the message suggest that it cannot connect to the database, as it once managed to create the database. However when I deleted the db to try again, running the drush command again did not create the database again. The settings.php file has been created, but it doesn't have the mysql user name or password in it. The server (XAMPP) is still running. Any suggestions on what might be wrong?

  • 1
    Run the same command as drush site-install standard --db-url='mysql://superadmin:password@localhost/drush-test' --site-name=Example --debug and show us the output of that. – tenken Mar 23 '15 at 17:24
  • Manually creating the DB before running Drush usually goes smoothly – Patrick Ryan Mar 23 '15 at 17:36
  • Thanks for the helpful comments. I will check them out as soon as I have Drush running again, as I am having this problem now! drupal.stackexchange.com/questions/152644/… – Paul Trotter Mar 24 '15 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.