O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Locking

There are two types of locking:

  • Internal locking: MySQL performs internal locking within the server itself to manage contention for table contents by multiple sessions
  • External locking: MySQL gives the option to client sessions to acquire a table lock explicitly for preventing other sessions from accessing the table

Internal locking: There are mainly two types of locks:

  • Row-level locks: The locking is granular to the level of rows. Only the rows that are accessed are locked. This allows simultaneous write access by multiple sessions, making them suitable for multi-user, highly concurrent, and OLTP applications. Only InnoDB supports row-level locks.
  • Table-level locks: MySQL uses table-level locking for MyISAM, MEMORY, and MERGE ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required