简体   繁体   English

MyISAM表是否自动锁定在MySQL中?

[英]Is MyISAM Table locking in MySQL automatic?

MySQL会自动在MyIsam表上执行读/写表锁,还是必须显式锁定表?

Beyond making reasonable efforts to make certain statements atomic, MyISAM doesn't have the concept of transactions and its related row level locking. 除了合理努力使某些语句成为原子之外,MyISAM还没有事务概念及其相关的行级锁定。

Therefore, you should use LOCK TABLES to avoid race conditions or data inconsistencies when you use multiple statements (eg a SELECT statement followed by multiple related UPDATE statements). 因此,当您使用多个语句时(例如, SELECT语句后跟多个相关的UPDATE语句),您应该使用LOCK TABLES来避免竞争条件或数据不一致。

See here about Pros and Cos Of MyISAM 在这里查看关于MyISAM的优点和成绩

MyISAM's About Internal Locking MyISAM关于内部锁定

MyISAM uses table-level locking. MyISAM使用表级锁定。 When a row is inserted or updated, all other changes to that table are held up until that request has been completed. 插入或更新行时,将保留对该表的所有其他更改,直到该请求完成。

Correct me if 'm wrong 如果错了,请纠正我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM