Session 1:

mysql> start transaction;
Query OK, 0 rows affected (0.00 sec) mysql> update ClientActionTrack20151125 set ip='2.2.2.2'; Warning: Using a password on the command line interface can be insecure.
+-----+------+-----------+------+---------+------+----------+---------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------+------+---------+------+----------+---------------------------------------------------+
| 447 | root | localhost | zjzc | Query | 5 | updating | update ClientActionTrack20151125 set ip='2.2.2.2' | 2016-11-25 17:40:26,39,447,root,localhost,zjzc
mysql[192.168.11.187] processid[447] root@localhost in db[zjzc] hold transaction time 39 mysql> select * from information_schema.innodb_trx\G;
*************************** 1. row ***************************
trx_id: 112075119
trx_state: RUNNING
trx_started: 2016-11-25 17:39:47
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 6115055
trx_mysql_thread_id: 447 my $hostSql = qq{SELECT
NOW(), (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(a.trx_started)) diff_sec,
b.id,
b.user,
b.host,
b.db
FROM
information_schema.innodb_trx a
INNER JOIN
information_schema.PROCESSLIST b ON a.TRX_MYSQL_THREAD_ID = b.id}; show processlist 看到的ID 447 就是 a.TRX_MYSQL_THREAD_ID = b.id 开启session 2: Database changed
mysql> update ClientActionTrack20151125 set ip='9.9.9.9'; Vsftp:/root# mysql -uroot -p1234567 -e"show processlist"
Warning: Using a password on the command line interface can be insecure.
+-----+------+----------------------+--------------------+---------+------+----------+---------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+----------------------+--------------------+---------+------+----------+---------------------------------------------------+
| 447 | root | localhost | zjzc | Query | 197 | updating | update ClientActionTrack20151125 set ip='2.2.2.2' |
| 454 | root | localhost | zjzc | Query | 3 | updating | update ClientActionTrack20151125 set ip='9.9.9.9' |
| 457 | root | 192.168.11.186:47208 | information_schema | Sleep | 1 | | NULL |
| 458 | root | localhost | NULL | Query | 0 | init | show processlist |
+-----+------+----------------------+--------------------+---------+------+----------+---------------------------------------------------+ 2016-11-25 17:43:39,232,447,root,localhost,zjzc
mysql[192.168.11.187] processid[447] root@localhost in db[zjzc] hold transaction time 232
2016-11-25 17:43:39,38,454,root,localhost,zjzc
mysql[192.168.11.187] processid[454] root@localhost in db[zjzc] hold transaction time 38
112075120,454,update ClientActionTrack20151125 set ip='9.9.9.9',112075119,447,update ClientActionTrack20151125 set ip='2.2.2.2'
mysql[192.168.11.187] blocking_thread[447] blocking_query[update ClientActionTrack20151125 set ip='2.2.2.2'] blocking waiting_thread[454]'s update ClientActionTrack20151125 set ip='9.9.9.9' 取的是 information_schema.innodb_trx:
r.trx_mysql_thread_id waiting_thread, b.trx_mysql_thread_id blocking_thread, mysql> select * from information_schema.innodb_trx\G;
*************************** 1. row ***************************
trx_id: 112075121
trx_state: LOCK WAIT
trx_started: 2016-11-25 17:45:27
trx_requested_lock_id: 112075121:442:4:149
trx_wait_started: 2016-11-25 17:45:27
trx_weight: 2
trx_mysql_thread_id: 454
trx_query: update ClientActionTrack20151125 set ip='9.9.9.9'
trx_operation_state: starting index read
trx_tables_in_use: 1
trx_tables_locked: 1
trx_lock_structs: 2
trx_lock_memory_bytes: 360
trx_rows_locked: 1
trx_rows_modified: 0
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 0
trx_autocommit_non_locking: 0
*************************** 2. row ***************************
trx_id: 112075119
trx_state: RUNNING
trx_started: 2016-11-25 17:39:47
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 19816885
trx_mysql_thread_id: 447
trx_query: update ClientActionTrack20151125 set ip='2.2.2.2'
trx_operation_state: updating or deleting
trx_tables_in_use: 1
trx_tables_locked: 1
trx_lock_structs: 638128
trx_lock_memory_bytes: 56555048
trx_rows_locked: 19816884
trx_rows_modified: 19178758
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 0
trx_autocommit_non_locking: 0
2 rows in set (0.13 sec) ERROR:
No query specified

show processlist 输出ID 和 information_schema.PROCESSLIST 的id,information_schema.innodb_trx的TRX_MYSQL_T的更多相关文章

  1. Andriod学习笔记2:“Your content must have a ListView whose id attribute is 'android.R.id.list'”问题的解决办法

    问题描述 activity_main.xml代码如下: <?xml version="1.0" encoding="utf-8"?> <Lin ...

  2. [BUG集] android 安卓项目中ORMLITE框架 Must specify one of id, generatedId, and generatedIdSequence with Id

    使用ORM框架ORMLITE有一段时间,今天在操作一个对象的时候,重新运行报错如下: Must specify one of id, generatedId, and generatedIdSeque ...

  3. 免费开发者证书真机调试App ID失效问题:&quot;Unable to add App ID because the &#39;10&#39; App ID limit in &#39;7&#39; days has been exceeded.&quot;解决方案(5月5号)

    免费开发者证书真机调试App ID失效问题:"Unable to add App ID because the '10' App ID limit in '7' days has been ...

  4. Android Your content must have a ListView whose id attribute is &#39;android.R.id.list&#39;错误的解决办法

    在Android开发中,ListView有着很重要的地位,使用的场合也非常的多 错误提示:Your content must have a ListView whose id attribute is ...

  5. Unable to add App ID because the &#39;10&#39; App ID limit in &#39;7&#39; days has been exceeded.

    Unable to add App ID because the '10' App ID limit in '7' days has been exceeded. 官方的原因是对bundle iden ...

  6. 获取json对象的id或者根据name获取id

    --用json的时候,知道id获取对应的name或者相反根据name获取id --内核代码 <script> var products=[{ID:1,Name:"a", ...

  7. linux系统学习笔记:无死角理解保存的设置用户ID,设置用户ID位,有效用户ID,实际用户ID

    一.基本概念 实际用户ID(RUID):用于标识一个系统中用户是谁,一般是在登录之后,就被唯一的确定,就是登录的用户的uid. 有效用户ID(EUID):用于系统决定用户对系统资源的权限,也就是说当用 ...

  8. hibernate利用mysql的自增张id属性实现自增长id和手动赋值id并存

    我们知道在mysql中如果设置了表id为自增长属性的话,insert语句中如果对id赋值(值没有被用到过)了,则插入的数据的id会为用户设置的值,并且该表的id的最大值会重新计算,以插入后表的id最大 ...

  9. 初学时遇到的小问题Your content must have a ListView whose id attribute is &#39;android.R.id.list&#39;

    问题提出 错误提示:Your content must have a ListView whose id attribute is 'android.R.id.list' 关于解决Your conte ...

随机推荐

  1. GIT 配置管理

    git版本控制开发流程小结笔记(一) 收藏                                                                     何良瑞Nyanko君 ...

  2. Python之路,day6-Python基础

    1.config 模块 import configparser conf = configparser.ConfigParser() conf[', 'Compression': 'yes', '} ...

  3. 以前5年只专注于.net,现今开始学习java.

    从2011年毕业至今一直在学习.net和c#,大概几年6月份底开始研究java了. 虽然不知道以后的路是否好走,但是我依然会努力.不放弃! 写这篇文字是为了鼓励自己,也为这段时光留下记忆.加油,红红!

  4. [渣译文] SignalR 2.0 系列: 支持的平台

    原文:[渣译文] SignalR 2.0 系列: 支持的平台 英文渣水平,大伙凑合着看吧,并不是逐字翻译的…… 这是微软官方SignalR 2.0教程Getting Started with ASP. ...

  5. smali语法(二)

    一.smali的包中信息 .class public Lcom/aaaaa; .super Lcom/bbbbb; .source "ccccc.java" 1.它是com.aaa ...

  6. 大数据 --&gt; 大数据关键技术

    大数据关键技术 大数据环境下数据来源非常丰富且数据类型多样,存储和分析挖掘的数据量庞大,对数据展现的要求较高,并且很看重数据处理的高效性和可用性. 传统数据处理方法的不足 传统的数据采集来源单一,且存 ...

  7. APP开发外包时常见的错误

    时代在发展,科技在进步,很多企业都想要开发出属于自己的一款APP.然而,不是每个企业都有开发团队或是专门雇一个技术人员来做的,有一个好方法就是把开发APP的工作外包出去,找一个比较好的外包公司根据自己 ...

  8. ubuntu14.4 分辨率偏低

    最近出了 14.04 LTS,就想安装上玩一玩.还是用 easybcd 从 windows硬盘安装.装完之后,显示效果不好于是做了如下处理: 1. 按下windows键,搜索 "附加驱动&q ...

  9. js 数组拷贝与深拷贝

    1.对于普通数组(数组元素为数字或者字符串) var _testCopy = [1,2,3].concat();//拷贝数组(浅拷贝) 2.对于对象数组 (深拷贝) //形如var _objArr=[ ...

  10. [React] 06 - Route: koa makes your life easier

    听说koa比express更傻瓜化,真的? Koa 框架教程 本身代码只有1000多行,所有功能都通过插件实现,很符合 Unix 哲学. 搭建简单服务器 Koa, 架设一个简单的服务器 // demo ...