MySQL Locking
15 September 2010
After experimenting a bit with MySQL locking today, I thought I’d make a note of what I’d discovered:
To create a lock, you need to use:
<code>LOCK TABLES table1 [READ |WRITE], table2 [READ |WRITE]</code>
READ is used to stop other people changing the table while you read from it. WRITE is used to stop other people reading the table while you write to it.
Once you have issued a LOCK TABLES statement, you will not have access to any tables you didn’t include.