Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

mysqldump --skip-lock-tables 

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

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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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