> -----Original Message----- > From: James Tu [mailto:jtu@xxxxxxxxxxxxx] > Sent: Tuesday, November 28, 2006 1:21 PM > To: PHP General List > Subject: Re: backing up a database > > Does one need to lock(?) MySQL before running mysqldump? > Or will the mysqldump command wait for any pending operations to > finish, lock the tables for dumping and once finished release the lock? > > -James It is my understanding that mysql will not do this unless specified. http://dev.mysql.com/doc/refman/4.1/en/mysqldump.html --lock-all-tables, -x Lock all tables across all databases. This is achieved by acquiring a global read lock for the duration of the whole dump. This option automatically turns off --single-transaction and --lock-tables. Added in MySQL 4.1.8. --lock-tables, -l Lock all tables before dumping them. The tables are locked with READ LOCAL to allow concurrent inserts in the case of MyISAM tables. For transactional tables such as InnoDB and BDB, --single-transaction is a much better option, because it does not need to lock the tables at all. Please note that when dumping multiple databases, --lock-tables locks tables for each database separately. Therefore, this option does not guarantee that the tables in the dump file are logically consistent between databases. Tables in different databases may be dumped in completely different states. -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php