Skip to content

Instantly share code, notes, and snippets.

@crittermike
Created January 17, 2017 02:45
Show Gist options
  • Save crittermike/ef648eca6906b72db9c2423be1b6f917 to your computer and use it in GitHub Desktop.
Save crittermike/ef648eca6906b72db9c2423be1b6f917 to your computer and use it in GitHub Desktop.
Drush gets "access denied" for a Drupal database?

If you're having an issue where Drush gets access denied for the database whenever you try to run a command, try running drush sql-connect. Doing so will return a mysql command line string you can paste to try to connect manually.

Paste that mysql command and run it. If that works fine, but Drush gets "access denied" when you try other commands such as drush sql-console, then see if there's a ~/.my.cnf file.

Sometimes, that file will hide itself away in the home directory and quiety do things like override passwords you pass in, etc. Check it out, and delete it if it's not helping you, then try again.

@crittermike
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment