12

If in understand correctly, running FLUSH TABLES WITH READ LOCK acquires a global read lock.

Is there any command I can run in the mysql client which shows me that lock is currently acquired?

davidbrai
  • 1,229
  • 1
  • 9
  • 14

2 Answers2

10

Try this :

SHOW ENGINE INNODB STATUS;

It will show owner of locks and waiters (and lot of other stuff related to innodb)

http://dev.mysql.com/doc/refman/5.0/en/innodb-monitors.html

http://www.xaprb.com/blog/2006/07/31/how-to-analyze-innodb-mysql-locks/

rkosegi
  • 14,165
  • 5
  • 50
  • 83
  • 2
    I'm familiar with the command, but it doesn't show global locks acquired by `flush tables with read lock` unless I missed it. – davidbrai Mar 19 '12 at 13:36
  • 1
    You need at least one of the PROCESS privileges for this operation. Any way I can do this without any PROCESS privileges? – wheeleruniverse Feb 12 '19 at 12:09
1

This is not a global lock.once you come out of session ,it releases it

Shahid Hussain
  • 1,599
  • 1
  • 20
  • 24
  • Given that the edit queue is full and not clearing... "FLUSH TABLES WITH READ LOCK" is a global lock, but it is also tied to the current login session only. To clear the READ LOCK, exit the session. There is not a command to run that clears it. Then log back in to a new SQL session and run SHOW FULL PROCESSLIST; and you will see that closing the previous session releases the lock, as all transactions will no longer be waiting. – sarlacii Jun 21 '22 at 09:10