Skip to content

Commit 7759338

Browse files
Update 2023-12-08-mysql常用命令.md
1 parent 5104e98 commit 7759338

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

_posts/2023-12-08-mysql常用命令.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ categories:
77
tags:
88
- mysql常用命令
99
---
10+
目录:
11+
* awsl
12+
{:toc}
1013

1114

15+
### mysql常用命令
1216
- 看所有线程:`show full processlist;`
1317
- 杀死进程: `kill 60882 ;`
1418
- 查看当前未提交的事务: ` select * from information_schema.innodb_trx;`
@@ -20,3 +24,13 @@ tags:
2024
- 查看binlog:`show binary logs;`
2125
- 查看binlog日志路径:`show variables like 'log_%';`
2226
- 解析binlog:`mysqlbinlog --no-defaults -d databasename --start-datetime="2017-09-17 07:21:09" --stop-datetime="2017-09-19 07:59:50" mysql-bin.000002`
27+
28+
29+
### my2sql binlog日志解析
30+
```sql
31+
# 解析本地binlog,指定数据库在指定日期范围内执行的sql
32+
./my2sql -user root -password '2vKeG&1.3' -host 127.0.0.1 -port 7501 -databases db_transfer -mode file -local-binlog-file ./binlog.000009 -start-datetime "2023-08-04 09:20:00" -stop-datetime "2023-08-04 09:50:00" -start-file binlog.000009 -work-type 2sql -output-dir ./tmpdir
33+
34+
# 解析本地binlog,指定数据库在指定日期范围内执行的sql,并生成回滚sql
35+
./my2sql -user root -password '2vKeG&1.3' -host 127.0.0.1 -port 7501 -databases db_transfer -mode file -local-binlog-file ./binlog.000009 -start-datetime "2023-08-04 09:20:00" -stop-datetime "2023-08-04 09:50:00" -start-file binlog.000009 -work-type rollback -output-dir ./tmpdir
36+
```

0 commit comments

Comments
 (0)