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

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.