List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 23 2002 3:47pm
Subject:Re: lock statement
View as plain text  
At 1:13 +1000 9/24/02, Chris Barnes wrote:
>hi people,
>just a quick question.
>is there a way i can use the "lock tables" statement to lock all the tables
>in a database which out having to specify all tables individually?
>i dont really want to use a statement like:
>lock tables table1 read, table2 read table3 read, table4 read, table5 read,
>table6 read, table7 read, table8 read, table9 read, table10 read;
>something like lock tables * read; or lock * write; would be nice but i cant
>find anything about that in the mysql documentation.

FLUSH TABLES WITH READ LOCK places a read lock on all tables.  This prevents
any updates to the tables.

However, note that this does not work for InnoDB tables, because the InnoDB
handler performs its own locking at a lower level so it doesn't see the
effect of the statement.

lock statementChris Barnes23 Sep
  • Re: lock statementPaul DuBois23 Sep