I'm trying to create a dump of a mysql databases stored procedures and table 'shapes' without locking any rows.

mysqldump -uread_only -p --routines -d --skip-add-locks the_db_name

This doesn't work because I don't have permission to lock the table. I shouldn't need to, as I don't want to copy the data itself. The stored procedures only change every year or so, so I would be unlucky to catch a conflict!

Many thanks.

link|improve this question
feedback

2 Answers

mysqldump --skip-lock-tables 

face-palm right there at the top of the man page

link|improve this answer
+1 for finding the answer yourself and for the self-inflicted face palm !!! – RolandoMySQLDBA Jan 4 at 18:57
feedback

Please keep in mind that you have to do that because Stored Procedures (SP) live in mysql.proc. That is a MyISAM table. SELECTs against mysql.proc create an implicit lock. Other databases may have SPs that need to be changed (Small possibility but possible nonetheless).

To ensure that no attributes about any SP is changed, an explicit lock is issued against mysql.proc. Doing --skip-lock-tables is OK to do, as long as you know that no other SP is being changed.

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.