MySQL???????????
?????danfengcao ???????[ 2017/1/4 11:13:47 ] ????????????? MySQL
????3??????λ?????????????????????sql??????????????λ????257427-504272???(binlog2sql?????????????????????start position)???????λ?ù??????? -B ?????????sql???????sql????????(???????????£????????SQL?????????????????????grep????????)
shell> python binlog2sql/binlog2sql.py -h127.0.0.1 -P3306 -uadmin -p'admin' -dtest -tuser --start-file='mysql-bin.000054' --start-position=257427 --stop-position=504272 -B > /tmp/rollback.sql
rollback.sql ?????
INSERT INTO `test`.`user`(`addtime`?? `id`?? `name`) VALUES ('2016-12-14 23:09:07'?? 24530?? 'tt'); #start 257427 end 504272 time 2016-12-26 11:44:56
INSERT INTO `test`.`user`(`addtime`?? `id`?? `name`) VALUES ('2016-12-12 00:00:00'?? 24529?? 'С??'); #start 257427 end 504272 time 2016-12-26 11:44:56
...
INSERT INTO `test`.`user`(`addtime`?? `id`?? `name`) VALUES ('2014-11-11 00:04:48'?? 2?? 'С?'); #start 257427 end 265754 time 2016-12-26 11:44:56
shell> wc -l /tmp/rollback.sql
16128 /tmp/rollback.sql
????4????????????sql???????л????????mysql????????????
????shell> mysql -h127.0.0.1 -P3306 -uadmin -p'admin' < /tmp/rollback.sql
????mysql> select count(*) from user;
????+----------+
????| count(*) |
????+----------+
????| 16389 |
????+----------+
????TIPS
????· ????????????????????????????SQL??
????· ????????????????ι?????????λ??????????????
????· ????????????д?????????sql?в?????????????????????????????????????????????????????????????ж??
????· ??л??sql????б????????????????????????????????????????仯?????????????????????м?(????????)?????????????????????????????????2??ò??????????
????· ????????????????????й????????????????????????????????????????????
????· ?????????仯??????????????????????????(??????)??
???????????????????????????SQL??????????
???????????
????MySQL??????????????????????????????2012?????????????patch??????????????·???????(????·???????????????????)????????????????????????patch?????????????????????????????????????????????????ж?λ????????mysql?汾?????????????????????????????????·??
?????????Щ??????????????????????
????· ?????????patch???????????????mysqlbinlog?С?????????patch??????
???????
?????????????mysqlbinlog??е??????????????????????????????????????δ???п????????????
????????????????
???????
??????????????????????????binlog????????????????????????????????????????????????????á??????ж?λ?????????mysql5.5??5.6??5.7??????patch???????????????????????????????????
????????????1??????Ч???????????У???????????????patch?????????????????????????????????????????????????????????????DBA???????mysql??????????????
????????????鷳???????mysql??????????????ɡ?
??????Щ????????????????????п????????
????· ??????????????????α???slave???binlog?????д??????binlog2sql??????
???????
??????????á?α???slave??binlog????????????????????????????????????????????????MySQL?汾???????????Щ?????????????????????????????
????????1???????С??????????????DBA??????????????????????
???????????ü???
???????
??????????MySQL server??
????· ??????????????????mysqlbinlog??????????????binlog?????????????????????????滻??
???????
???????д????????????????????????????
???????????ü???
????????????????
???????
???????????á?
???????????á?
???????????????????????????????????????????binlog2sql????????????mysqlbinlog??
????????DDL??flashback
??????????????flashback?????DML???????????????????????DDL??????????????binlog???????????????????row???£?binlog????DDL???????????????????仯??????DDL???????????????MySQL???????????DDL????????????????ж??mysql????汾?????DDL??????????????????????????patch??MySQL?????MariaDB???????ú???????DDL??flashback?????DDL????????????????????洢?????????????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???mysql?????????????mysql????? distinct?÷?MySQL?н???????????з??Mysql?????????MySQL Cluster??δ????????????????ν?MySQL??????????300???????MySQL???Uber???????????????????MySql SQL??????????MySQL?????????????????λЧ?????SQL???Java???????:?????MySQL???????linux?°??mysql????MySQL ???????????????????binlog??MySQL????????????Щ??????MySQL???????Mysql???????JDBC?????mysql?????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????