mysqldump: Got error: 1045: “Access denied for user … (using password: YES)” when using LOCK TABLES


Warning: Undefined array key "socialize_RedditWidget" in /home/phpacd/websites/shkodenko.com/wp-content/plugins/socialize/frontend/socialize-services.php on line 166

Then I’ve developed MySQL backup script I’ve faced an error:

mysqldump: Got error: 1045: "Access denied for user '...'@'localhost' (using password: YES)" when using LOCK TABLES

which was fixed by adding

--lock-tables=false

parameter to mysqldump command.

Also, if you dump InnoDB tables consider using the

--single-transaction=true

parameter. As it is described in MySQL 5.7 documentation page.