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.

link|improve this question

1  
Do you still get the error if you run mysqldump with --skip-add-locks ? – Martin May 11 '11 at 14:31
1  
Aha, that fixed it. I realized just now that it wasn't the mysql table, it was the performance_schema table, which I see in some docs requires the --skip-add-locks. – bryan kennedy May 11 '11 at 17:00
feedback

2 Answers

up vote 2 down vote accepted

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

link|improve this answer
feedback

--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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.