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 --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
--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.)
There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.