mysqldump: Got error: 1044: Access denied for user XXXX

Error:

mysqldump: Got error: 1044: Access denied for user ‘mysqlusername’@’%’ to database ‘mysql’ when using LOCK TABLES

Cause:

The CyberSecure Advanced software agent calls MySQL’s mysqldump program to take backups.

The message above suggests that the mysql user “mysqlusername” does not have sufficient rights to take the backup using LOCK TABLES.

Resolution:

Grant Lock privileges to the user for the databases in concern.

Also go through following URLs which shows how to grant LOCK TABLE privileges to the user for the database in concern.

http://forums.mysql.com/read.php?10,108835,192963#msg-192963

http://dev.mysql.com/doc/refman/5.1/en/access-denied.html