MySQL Locking tables details
MySQL allows a client session to acquire a table lock explicitly for preventing other sessions from accessing the table during a specific period. A client session can acquire or release table locks only for itself. It cannot acquire or release table locks for other sessions. Below are the method to check lock details: SHOW ENGINE INNODB STATUS This is generally very good, but it can get truncated, and simply may not contain every bit of info you need. Enable InnoDB Lock Monitor (enable the InnODb Lock Monitor by simply creating any innodb table named innodb_lock_monitor) This logs a lot of extra lock information in the SHOW ENGINE INNODB STATUS output, but it can get truncated too. Run "mysqladmin debug" Logs all lock info to the error log. Great because it logs all locks (i.e., none truncated) and it logs LOCK TABLE locks, which do not appear in SHOW INNODB STATUS even if on an InnoDB table, because LOCK TABLE is external to the Inno