最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

统计MySQLbinlog中的DML语句

来源:动视网 责编:小采 时间:2020-11-09 10:30:27
文档

统计MySQLbinlog中的DML语句

统计MySQLbinlog中的DML语句:统计MySQL binlog中的DML语句 MASTER@root@test 07:44:52gt;create table tab02(id int(10) primary key,name varchar(20)); Q 统计MySQL binlog中的DML语句 MASTER@root@test 07:44:52>create table
推荐度:
导读统计MySQLbinlog中的DML语句:统计MySQL binlog中的DML语句 MASTER@root@test 07:44:52gt;create table tab02(id int(10) primary key,name varchar(20)); Q 统计MySQL binlog中的DML语句 MASTER@root@test 07:44:52>create table


统计MySQL binlog中的DML语句 MASTER@root@test 07:44:52gt;create table tab02(id int(10) primary key,name varchar(20)); Q

统计MySQL binlog中的DML语句

MASTER@root@test 07:44:52>create table tab02(id int(10) primary key,name varchar(20));
Query OK, 0 rows affected (0.10 sec)

MASTER@root@test 08:34:54>
MASTER@root@test 08:34:54>
MASTER@root@test 08:34:54>insert into tab02 values(1,'ddd');
Query OK, 1 row affected (0.00 sec)

MASTER@root@test 08:34:59>insert into tab02 values(2,'ddd');
Query OK, 1 row affected (0.00 sec)

MASTER@root@test 08:35:01>insert into tab02 values(3,'ddd');
Query OK, 1 row affected (0.00 sec)

MASTER@root@test 08:35:03>insert into tab02 values(4,'ddd');
Query OK, 1 row affected (0.00 sec)

MASTER@root@test 08:35:04>insert into tab02 values(5,'ddd');
Query OK, 1 row affected (0.01 sec)

MASTER@root@test 08:35:07>insert into tab02 values(6,'ddd');
Query OK, 1 row affected (0.00 sec)

MASTER@root@test 08:35:09>delete from tab02 where id=6;
Query OK, 1 row affected (0.02 sec)

MASTER@root@test 08:35:19>update tab02 set where id=1
-> ;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

MASTER@root@test 08:35:39>update tab02 set where id=3;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

[root@mynode1 mysql]# /service/mysql/bin/mysqlbinlog binlog-master.000006 |\
> grep -i -e "^update" -e "^insert" -e "^delete" -e "^replace" -e "^alter" | \
> cut -c1-100 | tr '[A-Z]' '[a-z]' | \
> sed -e "s/\t/ /g;s/\`//g;s/(.*$//;s/ set .*$//;s/ as .*$//" | sed -e "s/ where .*$//" | \
> sort | uniq -c | sort -nr
7 insert into tab02 values
2 update tab02
1 delete from tab02

相关阅读:

MySQL 大DML操作建议

MySQL常用DDL、DML、DCL语言整理(附样例)

MySQL中binlog日记清理

文档

统计MySQLbinlog中的DML语句

统计MySQLbinlog中的DML语句:统计MySQL binlog中的DML语句 MASTER@root@test 07:44:52gt;create table tab02(id int(10) primary key,name varchar(20)); Q 统计MySQL binlog中的DML语句 MASTER@root@test 07:44:52>create table
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top