If I run:
LOCK TABLE table1, table2 READ
// DO STUFF
UNLOCK TABLES
Will this block all other sessions from accessing table1 and table2 if the table type is INNODB? If not, how do I then lock the table in INNODB?
在这里阅读这篇有用的文章:http ://www.mysqlperformanceblog.com/2012/07/31/innodb-table-locks/
在 MySQL 级别显式锁定表将阻止表被访问,并且不会显示在SHOW ENGINE INNODB STATUS
. LOCK TABLES
当您从性能角度使用 Innodb 表时,最好不要使用,因为 Innodb 使用行级锁。