Showing posts with label how to lock table in mysql. Show all posts
Showing posts with label how to lock table in mysql. Show all posts

Friday, July 9, 2010

How to lock a table in Mysql

in a session
use following
--> lock tables mySchema.myTable write;
In another session try to get
-->select count(*) from mySchema.myTable;

It will be locked till u say

--> unlock tables