mysqldump error: 1044: Access denied for user ... when using LOCK TABLES

A quick note on a MySQL error: I got the following error when using mysqldump this past weekend:

mysqldump: Got error: 1044: 
Access denied for user 'USER'@'localhost' to database 'DBNAME' when using LOCK TABLES

The solution to this problem/error was to use one of these mysqldump commands:

mysqldump --opt --lock-tables=false -u USER -p DBNAME > dump.sql
mysqldump --opt --single-transaction -u USER -p DBNAME > dump.sql

I normally don’t use the --lock-tables or --single-transaction options when using mysqldump, but when you encounter this error, this is the workaround.

(Honestly I can’t remember what I did differently when I created this MySQL database, and didn’t look into the problem more than finding this solution, as I was moving the database from one server to another.)

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.