3.帮助手册
bash bin/safe_delete -h
4.使用演示 查看表,删除手机号是“00175731528296189904”的数据,手机号不是索引字段
mysql(test@localhost mysqld.sock)> show create table wechat_binding \G*************************** 1. row ***************************Table: wechat_bindingCreate Table: CREATE TABLE `wechat_binding` (`id` int(20) NOT NULL AUTO_INCREMENT,`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',`sales_id` varchar(80) DEFAULT NULL COMMENT '销售编号',`open_id` varchar(45) NOT NULL COMMENT 'openID',`type` int(2) NOT NULL COMMENT '1 销售,2 用户',`phone` varchar(20) NOT NULL COMMENT '手机号',`create_time` datetime NOT NULL COMMENT '绑定时间', PRIMARY KEY (`id`,`open_id`,`type`), KEY `openIdIdx` (`open_id`) USING BTREE, KEY `phoneIdx` (`phone`) USING BTREE, KEY `salesIdIndex` (`sales_id`) USING BTREE) ENGINE=InnoDB AUTO_INCREMENT=5000001 DEFAULT CHARSET=utf81 row in set (0.03 sec)test的功能
bash bin/safe_delete --table=wechat_binding --database=test --count=2000 --time=1 --pri-name=id,open_id,type --where="phone='00175731528296189904'" --user=test --host=127.0.0.1 --port=3311 --type=test
get的功能
bash bin/safe_delete --table=wechat_binding --database=test --count=2000 --time=1 --pri-name=id,open_id,type --where="phone='00175731528296189904'" --user=test --host=127.0.0.1 --port=3311 --type=get
delete的功能
bash bin/safe_delete --table=wechat_binding --database=test --count=2000 --time=1 --pri-name=id,open_id,type --where="phone='00175731528296189904'" --user=test --host=127.0.0.1 --port=3311 --type=delete
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。