Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql lock query mode

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following talk about mysql lock query way, the secret of the text is close to the theme related. So, gossip will not talk about it, we look directly at the following bar, I believe that after reading mysql lock query method this article you will certainly benefit.

select IFNULL(wt.trx_mysql_thread_id,1) BLOCKING_THREAD_ID,

t.trx_mysql_thread_id THREAD_ID,

CONCAT(p.user,'@',p.host) USER,

l.lock_table LOCK_TABLE,

l.lock_index LOCKED_INDEX,

l.lock_type LOCK_TYPE,

l.lock_mode LOCK_MODE,

CONCAT(

FLOOR(HOUR(TIMEDIFF(now(), t.trx_wait_started)) / 24), 'day ',

MOD(HOUR(TIMEDIFF(now(), t.trx_wait_started)), 24), ':',

MINUTE(TIMEDIFF(now(), t.trx_wait_started)), ':',

second(TIMEDIFF(now(), t.trx_wait_started))) AS WAIT_TIME,

t.trx_started TRX_STARTED,

t.trx_isolation_level TRX_ISOLATION_LEVEL,

t.trx_rows_locked TRX_ROWS_LOCKED,

t.trx_rows_modified TRX_ROWS_MODIFIED,

p.info SQL_TEXT

from INFORMATION_SCHEMA.INNODB_TRX t

LEFT JOIN information_schema.innodb_lock_waits w on t.trx_id = w.requesting_trx_id

LEFT JOIN information_schema.innodb_trx wt on wt.trx_id = w.blocking_trx_id

INNER JOIN information_schema.innodb_locks l on l.lock_trx_id = t.trx_id

INNER JOIN information_schema.processlist p on t.trx_mysql_thread_id = p.id

ORDER BY 1

For the above mysql lock query method related content, what do you still do not understand? Or if you want to know more about it, you can continue to pay attention to our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report