0

Does MySQL automatically peform read / write table locks on MyIsam tables, or do I have to explicitly lock the tables?

mogronalol
  • 2,946
  • 8
  • 38
  • 56

2 Answers2

1

Beyond making reasonable efforts to make certain statements atomic, MyISAM doesn't have the concept of transactions and its related row level locking.

Therefore, you should use LOCK TABLES to avoid race conditions or data inconsistencies when you use multiple statements (e.g. a SELECT statement followed by multiple related UPDATE statements).

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309
1

See here about Pros and Cos Of MyISAM

MyISAM's About Internal Locking

MyISAM uses table-level locking. 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

thar45
  • 3,518
  • 4
  • 31
  • 48