by Bente Olsen.
Hi Ken
Thank you for your reply, it made me a bit wiser, though it did not solve my actual problem.
I just discovered that
Access denied for user 'moodleuser'@'localhost' to database 'moodle' when using LOCK TABLES
means, that the user do not have a privilege called LOCK TABLES, so that must be required for the command mysqldump. It could also indicate that a mysqldump will lock the db entries, so it should only be performed when Moodle is in maintenance mode? Anyway, after applying LOCK TABLES to my db-user - which is not recommended in Moodle Docs - I could make my db dump. That could indicate that it is better to let the mysql superuser make the db dump on a production server?
BTW I prefer the command from the forum prior to the one in Moodle Docs, as it does not include the pw in the command.