>Hi,
>
>I'm using mysqldump to backup my databases.  Does anyone know if mysqldump
>locks all the tables in the database prior to performing the dump?
>
>I ask this because if an update is in progress which inserts/modifies
>records in several tables, performing a mysqldump could backup the database
>in an inconsistent state (partial transaction).

If an update is in progess, there's an implicit write lock on the table,
so no client, including mysqldump, can read it until the update completes.

mysqldump has a --lock-tables option, but what this does is put an
explicit read lock on every table that it's going to dump before it
dumps any of them, then unlocks them all.  If you do this for an entire
database, that effectively prevents any updates on any tables for
the duration of the dump.  (Other clients can read during the update,
because read locks don't block other readers.)

>
>Thanks,
>Don

-- 
Paul DuBois, [EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to