by William Hooper.
I had the same error message about LOCK TABLES, using MariaDB with the InnoDB engine. After finding a similar problem discussed here:
http://stackoverflow.com/a/105207/2619926
I added the '--single-transaction' option to the mysqldump command line, i.e.:
mysqldump --single-transaction -h example.com -u myusername --password=mypassword -C -Q -e --create-options mydatabasename > moodle-database.sql
The command worked for me, without the need to change user privileges or modify any tables.