Can't backup the mysql table with mysqldump. SELECT,LOCK TABL command denied for 'cond_instances' [closed]

I am having trouble running mysqldump as the mysql root user. When I try to backup the mysql table I get this error:

mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user
'root'@'localhost' for table 'cond_instances' when using LOCK TABLES

Anyone seen that before? I've seen some references to my mysql and my mysqldump being different versions but when I run which they are in the same directory.

I am running MySQL 5.5.8.


Add --skip-add-locks to your mysqldump command


--skip-add-locks doesn't work :

# mysqldump -u root -p`cat mysqlRoot.txt` --databases performance_schema --routines --quote-names --skip-add-locks > mysql_performance_schema

mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances' when using LOCK TABLES

you want --skip-lock-tables instead


(I realize this comes 8 months late)

This is not a problem of locks, and the offered solutions merely bypass the real problem:

A 5.5 mysqldump application should not export the performance_schema database in the first place.

Based on my previous experience, I suggest that the mysqldump program you have used is a 5.1 version. How to tell? Issue:

mysqldump --version

A 5.1 client is unaware of the "futuristic" existence of performance_schema and therefore attempts to dump it. It is unaware that it should not.

Try and find the 5.5 version, and use it for dumping, without adding the suggested locks, and this should work well.