I am from Ukraine, so sorry for my bad English... Please help me to fix a problem. I'm trying to install Drupal with Drush on shared hosting.

I use the command drush site-install. On localhost everything worked correctly, but on the hosting I get an error: Access denied for user 'bigferwn_t'@'localhost' to database 'bigferwn_t'.

Command string is 100% correct. The problem lies with permissions. When Drush runs the site-install command it DROPs the RECREATEs the db. So if the db user does not have that permission (like in many hosting provider) we get the error access denied.

So I created a db in hosting account manually and want to install drupal using the database that I just created. I don't want to drop and recreate this db. I simply want use the existing database.

There are issues discussing the same problem https://www.drupal.org/node/1105514.

In the site-install command there is no option to "NOT CREATE OR DROP DB" or if there is I can't find it.

I tried to use the patch from https://www.drupal.org/files/issues/drush-script-options.patch which was proposed in the issue above, but it is old and for a different version of drush.

  • 1
    Have you tried drush sql-drop? You can see the command here: drush.ws/#sql-drop This command allows you to drop all tables in a database without actually destroying the database. Drupal requires a database be completely empty before starting the install process. Once you run this, you should be able to access www.your-site.com/install.php or run your site install command.
    – Webdrips
    Commented Sep 13, 2014 at 10:54

2 Answers 2


Drush doesn't and likely isn't going to support this workflow based on developer comments in these pull requests:



Your remaining option is to install using the Drupal installer script.


It is not my case. In my case, user has not permission to drop and create db (because it's shared hostin). He only can use it.

So, I can create a new database only through the hosting control panel.

When I create new db, for example:

Db_name - testdrupal db_pass - testpass

and then in my drupal directory (where are all drupal files...) i run drush command:

drush si --db-url=mysql://testdrupal:testpass@localhost/testdrupal --account-name=admin --account-pass=1 -y

I get the error Access denied for user 'testdrupal'@'localhost' to database 'testdrupal'. could not drop and create database.

That's happened because when run site inctall command, drush trying to create db thas is aleady created, and user has no permission to do that.

Here is some patch https://www.drupal.org/node/1105514 to run site install command without crate db options.. But I can not modify it to drush 6.

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.