统计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
相关阅读:
KGOGOMall 是一套采用 Php + MySql 开发的基于 WEB 应用的 B/S 架构的B2C网上商店系统。具有完善的商品管理、订单管理、销售统计、新闻管理、结算系统、税率系统、模板系统、搜索引擎优化,数据备份恢复,会员积分折扣功能,不同的会员有不同的折扣,支持多语言,模板和代码分离等,轻松创建属于自己的个性化用户界面。主要面向企业和大中型网商提供最佳保障,最大化满足客户目前及今后的独立
0
MySQL 大DML操作建议
MySQL常用DDL、DML、DCL语言整理(附样例)
MySQL中binlog日记清理

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号