mysqldump: Got error: 1044: Access denied for user 'username'@'localhost' to database 'databasename' when using LOCK TABLES mysqldump: Got error: 1044: Access denied for user 'username'@'localhost' to database 'databasename' when using LOCK TABLES

I am able to loging properly and able to take full backup from SQLyog Tool but when i am trying to take backup from MySQL Enterprise Workbencg then getting error message.


  mysqldump: Got error: 1044: Access denied for user 'myuserid'@'%' to
  database 'mydatabasename' when doing LOCK TABLES


Operation failed with exitcode 2

And MySQL Connection status is ok.


  mysql> status;
  
  mysql.exe Ver 14.14 Distrib 5.6.19, for Win32 (x86)
  
  Connection id: 23921 Current database: databasename Current user: user
  id is ok here SSL: Not in use Using delimiter: ; Server version:
  5.6.17-log MySQL Community Server (GPL) Protocol version: 10 Connection: connection is ok here Server characterset: utf8 Db
  characterset: utf8 Client characterset: cp850 Conn. characterset:
  cp850 TCP port: 3306 Uptime: 21 days 21 hours 11 min 37 sec
  
  Threads: 24 Questions: 20500671 Slow queries: 3212 Opens: 121998 Flush
  tables: 1 Open tables: 2000 Queries per second avg: 10.842
I know it's really late, but I found this question when I faced the same problem. So, in case anyone need, I found two possible solutions, either:

your user is missing the LOCK privilege, so you should ask your database administrator to grant it to you
run the same mysqldump command, simply adding the --single-transaction flag, eg. mysqldump --single-transaction -u user -p ...