When I try to install a site using drush site-install, I end up with an error
ERROR 1044 (42000) at line 1: Access denied for user 'kenji'@'localhost' to database 'drupaltest'
but when I install the site through the standard http://mysite.com/install.php with the same db_url value set in settings.php, everything is working fine.
I have no idea where this could come from and i'd really appreciate help since drush is really a great tool i'd like to continue to use.
Thanks !
Just in case you wonder, 'kenji'@'localhost' has been grant the following on mysql SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES
Comments
Comment #1
trickpatty commentedI had the same problem. I looked forever, but forgot to check the most obvious thing... spelling errors.
(dupal != drupal)
Good luck!
Comment #2
jonhattanThat access denied is to drop-create the database. I think drush should continue and empty the database by dropping table by table.
Comment #3
msonnabaum commentedI get this too.
Is there any reason we need to drop? Seems like we could truncate all tables instead and avoid this error.
Comment #4
greg.1.anderson commentedThis is related to #716412: add a --delete-all-tables-first option for sql-sync ? -- I thought there was a duplicate issue somewhere specifically related to drop table vs drop db, but could not find it. Anyway, drush is supposed to try to drop all tables first, then fall back to dropping and creating the database. The create database code path is important in cases where the database does not exist at all yet.
Supposedly on my plate to fix this, but I've been busy and not had much time in the drush queue lately. Wouldn't mind if someone else came up with a patch.
Comment #5
moshe weitzman commentedWe do try to drop all tables if the DROP/CREATE fails. If both fail, we error with a message that could be clearer.
Comment #6
greg.1.anderson commentedThat's why I couldn't find the dup issue -- already committed. :)
Comment #7
coredumperror commentedI'm having this same problem, but the error message I get is slightly different, which I'm hoping will shed some light on this to the devs:
sudo drush site-install -y --db-url=mysql://drupal_prod:
@our-amazon-cloud-DB-server/drupal_prod1 --account-name=administrator --account-pass=
--account-mail="name@place.edu" --site-name="Our School"
You are about to create a sites/default/files directory and create a sites/default/settings.php file and DROP your 'drupal_prod1' database and then CREATE a new one. Do you want to continue? (y/n): y
ERROR 1044 (42000) at line 1: Access denied for user 'drupal_prod'@'%' to database 'drupal_prod1'
No tables to drop. [ok]
I don't actually get an error message from drush (just the one mysql is spitting out), but the site-install command seems to be failing anyway. When I subsequently try to access the site, nothing happens. The page loads, but there's nothing there.
I know that the db-url string is correct, because logging in directly using the mysql client (or phpMyAdmin) with the same credentials works, and I can drop and create the database just fine.
Comment #8
moshe weitzman commentedComment #9
holtzermann17 commentedHi Moshe, I'm seeing the "no tables to drop" version of this issue; since I didn't find the duplicate issue, I'm reopening the ticket.
Comment #10
holtzermann17 commentedI found that
GRANT ALL ...gives enough permission to make the drush command run to completion. The home page looks OK, but clicking around leads to 404 not found errors. But this seems like a different issue from the one described here!Comment #11
jcuzella commentedI am encountering this issue when running a drush site-upgrade without the --db-su and --db-su-pw flags. I also am seeing #1135588: 'drush cli' results in 'sh: /dev/pts/1: Permission denied' error as well.
This is using a fresh install of Drupal 6.22, and trying to upgrade to 7.8. I am re-opening this issue because it does not appear to be fixed correctly.
Running drush as non-root user with the following site.aliases:
I run drush like so:
Comment #12
jcuzella commentedJust ran the site-upgrade using the above site aliases file, no --db-su or --db-su-pw flags, and the --debug flag, and got the following output:
( Scrubbed for db passwords ):
It still is running the DROP DATABASE sql command, which fails as non-root without the drop permission:
Comment #13
greg.1.anderson commentedPlease do not open old unrelated issues with vaguely similar error messages to post new support requests. Please use drush-5.x to reproduce, and follow the instructions here: http://drupal.org/node/add/project-issue/drush
Comment #14
svrl commentedHello Dru-Com,
I solved this problem using another DB user, root actually.
In order to cause this bug I used none existing user, after I used root who is existing by default i had not problem.
Have a nice day"
Comment #15
prasanna_drupal commentedBut using root user for site creation is not a good idea, we need have a different data base user.
I am also facing the same issue.
with root user, site is being created.
Is there any other solution to create the site with the user other than root.
Please help
Details are:
I am installing drupal 8.7.10
and using drush 8.0.3 (Installed through composer)
OS : Linux Centios 7