MySQLDUMP – Use –skip-lock-tables Option

MySQLmysqldump

--skip-lock-tables

when i am taking mysqldump with this option or without this,I am not able to identify any difference. Tables are not getting locked in any of these cases. I thought mysql will lock tables without this option and after this option i am able to query table, however in both of this cases i am able to query to all the tables. Please suggest.

Best Answer

When performing a backup of a database, MySQL locks the tables by default in order to ensure that the data does not change while the backup is under way. Instructing MySQL to skip this process opens the data to the possibility that some user will insert or delete or do some other operation that would result in an incomplete backup. Performing a normal query should not be a problem since data is not being changed.

You might want to try an insert or delete operation while a backup is under way to test more fully. The type of database ISAM/Innodb is also an issue since the behaviour may be different.

See for example MySQL docs and a similar question here.