1.表锁
表可以被显示的读锁和写锁进行锁定
2.全局锁
可以通过FIUSH TABLES WITH LOCK或设置read_only=1来获取单个全局读锁,他与任何表锁冲突
3.命名锁
命名锁是表锁的一种,服务器在重名或删除一个表时创建
4.字符锁
你可以用GET_LOCK()及相关函数在服务器内锁住和释放任何一个字符串
表锁
表锁已是显示的也是隐式的,显示的用Lock tables创建,如果在mysql中执行下列命令‘
mysql>lock tables 数据库.表名read;