Search code examples
mysqldatabaselockingtable-lockingdatabase-concurrency

Lock an entire single table but still allow to access other tables in the same session on MySQL


Is it possible to lock a single table on MySQL for a session and still be able to read and write on other unlocked tables on the same session that locked that table while the table is still locked?


Solution

  • Yes, LOCK TABLES does exactly this.