需求:
1、创建一个数据库 oldboy
2、在oldboy下创建一张表t1
3、插入5行任意数据
4、全备
5、插入两行数据,任意修改3行数据,删除1行数据
6、删除所有数据
7、再t1中又插入5行新数据,修改3行数据
需求,跳过第六步恢复表数据

分析问题解决问题

1 如果没有误操作 数据会是什么样 先模拟

 #-------------------------------------------------------------------------------
#
# day8 练习
# Author:nod
# Date:18-08-05
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#
# 本次练习题当中6为误操作,因而处理方式就是跳过第六步看看正常数据如何
# 再按步骤1-7在主库上进行操作 恢复数据等进行测试
#------------------------------------------------------------------------------- 需求:
1、创建一个数据库 oldboy
2、在oldboy下创建一张表t1
3、插入5行任意数据
4、全备
5、插入两行数据,任意修改3行数据,删除1行数据
6、删除所有数据
7、再t1中又插入5行新数据,修改3行数据
需求,跳过第六步恢复表数据 mysql> create database oldboy;
mysql> use oldboy;
mysql> create table t1(id int);
mysql> insert into t1 values(1),(2),(3),(4),(5);
mysql> select * from t1;
+------+
| id |
+------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
+------+ # 插入两行数据,任意修改3行数据,删除1行数据
mysql> insert into t1 values(6),(7);
mysql> update t1 set id=11 where id=1;
mysql> update t1 set id=22 where id=2;
mysql> update t1 set id=33 where id=3;
mysql> delete from t1 where id=7; # 再t1中又插入5行新数据,修改3行数据
mysql> insert into t1 values(8),(9),(10),(11),(12);
mysql> update t1 set id=100 where id=10;
mysql> update t1 set id=110 where id=11;
mysql> update t1 set id=120 where id=12; # 正确效果数据
mysql> select * from t1;
+------+
| id |
+------+
| 110 |
| 22 |
| 33 |
| 4 |
| 5 |
| 6 |
| 8 |
| 9 |
| 100 |
| 110 |
| 120 |
+------+

分析后得出对应的解决方法

全备恢复 +第5步骤+第七步骤 跳过第六步骤 需要对mysqlbinlog进行分析

#-------------------------------------------------------------------------------
#
# day8 练习实际步骤
# Author:nod
# Date:18-08-05
#------------------------------------------------------------------------------- 需求:
1、创建一个数据库 oldboy
2、在oldboy下创建一张表t1
3、插入5行任意数据
4、全备
5、插入两行数据,任意修改3行数据,删除1行数据
6、删除所有数据
7、再t1中又插入5行新数据,修改3行数据
需求,跳过第六步恢复表数据 #-------------------------------------------------------------------------------
# 1-3步骤
#-------------------------------------------------------------------------------
mysql> flush logs;
mysql> create database oldboy;
mysql> use oldboy;
Database changed
mysql> create table t1(id int);
mysql> insert into t1 values(1),(2),(3),(4),(5); #-------------------------------------------------------------------------------
# 全备
#------------------------------------------------------------------------------- mysqldump -uroot -p123 -A -R --triggers --master-data=2 --single-transaction > /backup/full3.sql #-------------------------------------------------------------------------------
# 5 插入两行数据,任意修改3行数据,删除1行数据
#------------------------------------------------------------------------------- mysql> insert into t1 values(6),(7);
mysql> update t1 set id=11 where id=1;
mysql> update t1 set id=22 where id=2;
mysql> update t1 set id=33 where id=3;
mysql> delete from t1 where id=7; #-------------------------------------------------------------------------------
# 6 删除所有数据 1637
#-------------------------------------------------------------------------------
#
mysql> delete from t1; #-------------------------------------------------------------------------------
# 7 再t1中又插入5行新数据,修改3行数据
#-------------------------------------------------------------------------------
mysql> insert into t1 values(8),(9),(10),(11),(12); 1702 2586
mysql> update t1 set id=100 where id=10;
mysql> update t1 set id=110 where id=11;
mysql> update t1 set id=120 where id=12; #-------------------------------------------------------------------------------
# 脏数据
#-------------------------------------------------------------------------------
mysql> select * from t1;
+------+
| id |
+------+
| 8 |
| 9 |
| 100 |
| 110 |
| 120 |
+------+
5 rows in set (0.00 sec) #-------------------------------------------------------------------------------
# 数据处理部分
#-------------------------------------------------------------------------------
# #-------------------------------------------------------------------------------
# 数据分析/backup/full3.sql
#------------------------------------------------------------------------------- 22:CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000013', MASTER_LOG_POS=533; #-------------------------------------------------------------------------------
# 数据分析mysql-bin.000013
#-------------------------------------------------------------------------------
mysqlbinlog --base64-output=decode-rows -vvv /data/mysql/mysql-bin.000013
mysqlbinlog --start-position=533 --stop-position=1590 /data/mysql/mysql-bin.000013 >/backup/inc1.sql
mysqlbinlog --start-position=1702 --stop-position=2586 /data/mysql/mysql-bin.000013 >/backup/inc2.sql #-------------------------------------------------------------------------------
# 在备份库上进行主库全备恢复+步骤6 步骤7操作恢复
#-------------------------------------------------------------------------------
mysql> source /backup/full3.sql;
mysql> source /backup/inc1.sql
mysql> source /backup/inc2.sql #-------------------------------------------------------------------------------
# ERROR 1666 (HY000): Cannot execute statement: impossible to write to binary log since statement is in row # # format and BINLOG_FORMAT = STATEMENT.
# 解决方法:
# 主库是row模式 因而备份库也要row模式 修改后解决
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# 验证数据 数据恢复正确
#-------------------------------------------------------------------------------
mysql> select * from t1;
+------+
| id |
+------+
| 110 |
| 22 |
| 33 |
| 4 |
| 5 |
| 6 |
| 8 |
| 9 |
| 100 |
| 11 |
| 120 |
+------+
11 rows in set (0.00 sec) #-------------------------------------------------------------------------------
# 将带有误操作(删除)的t1表导出
#-------------------------------------------------------------------------------
[root@db01 backup]# mysqldump -uroot -p123 -S /data/3307/mysql.sock oldboy t1 >/backup/t1.sql #-------------------------------------------------------------------------------
# 主库进行恢复t1表操作
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# 查看oldboy下t1的数据,目前数据应该是有问题的数据
#-------------------------------------------------------------------------------
mysql> use oldboy;
mysql> select * from t1;
+------+
| id |
+------+
| 8 |
| 9 |
| 100 |
| 110 |
| 120 |
+------+
5 rows in set (0.00 sec) #-------------------------------------------------------------------------------
# 开始恢复t1操作
#-------------------------------------------------------------------------------
mysql> source /backup/t1.sql;
Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.02 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.07 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.01 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 11 rows affected (0.01 sec)
Records: 11 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) #-------------------------------------------------------------------------------
# 恢复完毕 检查数据 恢复操作完成
#------------------------------------------------------------------------------- mysql> select * from t1;
+------+
| id |
+------+
| 110 |
| 22 |
| 33 |
| 4 |
| 5 |
| 6 |
| 8 |
| 9 |
| 100 |
| 11 |
| 120 |
+------+
11 rows in set (0.00 sec)

分析的binlogcode

要对比分析begin commit 要多加体会

 #-------------------------------------------------------------------------------
#
# day8练习题binlog文件
#------------------------------------------------------------------------------- [root@db01 backup]# mysqlbinlog --base64-output=decode-rows -vvv /data/mysql/mysql-bin.000013
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#180805 23:51:27 server id 6 end_log_pos 120 CRC32 0xd5be46c7 Start: binlog v 4, server v 5.6.38-log created 180805 23:51:27
# at 120
#180805 23:51:36 server id 6 end_log_pos 220 CRC32 0xeaa89679 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484296/*!*/;
SET @@session.pseudo_thread_id=13/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=1075838976/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=33/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create database oldboy
/*!*/;
# at 220
#180805 23:52:19 server id 6 end_log_pos 321 CRC32 0x23a9496d Query thread_id=13 exec_time=0 error_code=0
use `oldboy`/*!*/;
SET TIMESTAMP=1533484339/*!*/;
create table t1(id int)
/*!*/;
# at 321
#180805 23:52:30 server id 6 end_log_pos 395 CRC32 0x73300da7 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484350/*!*/;
BEGIN
/*!*/;
# at 395
#180805 23:52:30 server id 6 end_log_pos 442 CRC32 0xe87526c3 Table_map: `oldboy`.`t1` mapped to number 283
# at 442
#180805 23:52:30 server id 6 end_log_pos 502 CRC32 0x681dd9f1 Write_rows: table id 283 flags: STMT_END_F
### INSERT INTO `oldboy`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=4 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
# at 502
#180805 23:52:30 server id 6 end_log_pos 533 CRC32 0x0b8ae04d Xid = 9250
COMMIT/*!*/;
# at 533
#180805 23:55:47 server id 6 end_log_pos 607 CRC32 0x9df4f1c1 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484547/*!*/;
BEGIN
/*!*/;
# at 607
#180805 23:55:47 server id 6 end_log_pos 654 CRC32 0x5f289eed Table_map: `oldboy`.`t1` mapped to number 324
# at 654
#180805 23:55:47 server id 6 end_log_pos 699 CRC32 0x56cbcd59 Write_rows: table id 324 flags: STMT_END_F
### INSERT INTO `oldboy`.`t1`
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=7 /* INT meta=0 nullable=1 is_null=0 */
# at 699
#180805 23:55:47 server id 6 end_log_pos 730 CRC32 0xd3310e29 Xid = 10117
COMMIT/*!*/;
# at 730
#180805 23:55:52 server id 6 end_log_pos 804 CRC32 0x4fa560fa Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484552/*!*/;
BEGIN
/*!*/;
# at 804
#180805 23:55:52 server id 6 end_log_pos 851 CRC32 0x0c2cb62f Table_map: `oldboy`.`t1` mapped to number 324
# at 851
#180805 23:55:52 server id 6 end_log_pos 897 CRC32 0x7641ef30 Update_rows: table id 324 flags: STMT_END_F
### UPDATE `oldboy`.`t1`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */
# at 897
#180805 23:55:52 server id 6 end_log_pos 928 CRC32 0xc96642d8 Xid = 10118
COMMIT/*!*/;
# at 928
#180805 23:55:58 server id 6 end_log_pos 1002 CRC32 0xaa5b0537 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484558/*!*/;
BEGIN
/*!*/;
# at 1002
#180805 23:55:58 server id 6 end_log_pos 1049 CRC32 0xef25a191 Table_map: `oldboy`.`t1` mapped to number 324
# at 1049
#180805 23:55:58 server id 6 end_log_pos 1095 CRC32 0x93732ae2 Update_rows: table id 324 flags: STMT_END_F
### UPDATE `oldboy`.`t1`
### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=22 /* INT meta=0 nullable=1 is_null=0 */
# at 1095
#180805 23:55:58 server id 6 end_log_pos 1126 CRC32 0xfeee4a7c Xid = 10119
COMMIT/*!*/;
# at 1126
#180805 23:56:04 server id 6 end_log_pos 1200 CRC32 0x4134c384 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484564/*!*/;
BEGIN
/*!*/;
# at 1200
#180805 23:56:04 server id 6 end_log_pos 1247 CRC32 0x3e17dba1 Table_map: `oldboy`.`t1` mapped to number 324
# at 1247
#180805 23:56:04 server id 6 end_log_pos 1293 CRC32 0x758c18dd Update_rows: table id 324 flags: STMT_END_F
### UPDATE `oldboy`.`t1`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=33 /* INT meta=0 nullable=1 is_null=0 */
# at 1293
#180805 23:56:04 server id 6 end_log_pos 1324 CRC32 0x2838e762 Xid = 10120
COMMIT/*!*/;
# at 1324
#180805 23:56:09 server id 6 end_log_pos 1398 CRC32 0x3101a798 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484569/*!*/;
BEGIN
/*!*/;
# at 1398
#180805 23:56:09 server id 6 end_log_pos 1445 CRC32 0x4173fe96 Table_map: `oldboy`.`t1` mapped to number 324
# at 1445
#180805 23:56:09 server id 6 end_log_pos 1485 CRC32 0xc1755087 Delete_rows: table id 324 flags: STMT_END_F
### DELETE FROM `oldboy`.`t1`
### WHERE
### @1=7 /* INT meta=0 nullable=1 is_null=0 */
# at 1485
#180805 23:56:09 server id 6 end_log_pos 1516 CRC32 0xeb175961 Xid = 10121
COMMIT/*!*/;
# at 1516
#180805 23:56:43 server id 6 end_log_pos 1590 CRC32 0xce6b49dd Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484603/*!*/;
BEGIN
/*!*/;
# at 1590
#180805 23:56:43 server id 6 end_log_pos 1637 CRC32 0xcc5d90fa Table_map: `oldboy`.`t1` mapped to number 324
# at 1637
#180805 23:56:43 server id 6 end_log_pos 1702 CRC32 0x67646caa Delete_rows: table id 324 flags: STMT_END_F
### DELETE FROM `oldboy`.`t1`
### WHERE
### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM `oldboy`.`t1`
### WHERE
### @1=22 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM `oldboy`.`t1`
### WHERE
### @1=33 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM `oldboy`.`t1`
### WHERE
### @1=4 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM `oldboy`.`t1`
### WHERE
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### DELETE FROM `oldboy`.`t1`
### WHERE
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
# at 1702
#180805 23:56:43 server id 6 end_log_pos 1733 CRC32 0xda91d5fc Xid = 10122
COMMIT/*!*/;
# at 1733
#180805 23:57:48 server id 6 end_log_pos 1807 CRC32 0x9c648b02 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484668/*!*/;
BEGIN
/*!*/;
# at 1807
#180805 23:57:48 server id 6 end_log_pos 1854 CRC32 0x705c9c37 Table_map: `oldboy`.`t1` mapped to number 324
# at 1854
#180805 23:57:48 server id 6 end_log_pos 1914 CRC32 0xa37a228b Write_rows: table id 324 flags: STMT_END_F
### INSERT INTO `oldboy`.`t1`
### SET
### @1=8 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=9 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=10 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO `oldboy`.`t1`
### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
# at 1914
#180805 23:57:48 server id 6 end_log_pos 1945 CRC32 0x704ab243 Xid = 10125
COMMIT/*!*/;
# at 1945
#180805 23:57:54 server id 6 end_log_pos 2019 CRC32 0x733a9b67 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484674/*!*/;
BEGIN
/*!*/;
# at 2019
#180805 23:57:54 server id 6 end_log_pos 2066 CRC32 0xa8ee9f3a Table_map: `oldboy`.`t1` mapped to number 324
# at 2066
#180805 23:57:54 server id 6 end_log_pos 2112 CRC32 0x69de9370 Update_rows: table id 324 flags: STMT_END_F
### UPDATE `oldboy`.`t1`
### WHERE
### @1=10 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=100 /* INT meta=0 nullable=1 is_null=0 */
# at 2112
#180805 23:57:54 server id 6 end_log_pos 2143 CRC32 0x436ebefc Xid = 10126
COMMIT/*!*/;
# at 2143
#180805 23:57:59 server id 6 end_log_pos 2217 CRC32 0x40f410d1 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484679/*!*/;
BEGIN
/*!*/;
# at 2217
#180805 23:57:59 server id 6 end_log_pos 2264 CRC32 0x413676a6 Table_map: `oldboy`.`t1` mapped to number 324
# at 2264
#180805 23:57:59 server id 6 end_log_pos 2310 CRC32 0xbf31e991 Update_rows: table id 324 flags: STMT_END_F
### UPDATE `oldboy`.`t1`
### WHERE
### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=110 /* INT meta=0 nullable=1 is_null=0 */
# at 2310
#180805 23:57:59 server id 6 end_log_pos 2341 CRC32 0x65c77e3d Xid = 10127
COMMIT/*!*/;
# at 2341
#180805 23:58:03 server id 6 end_log_pos 2415 CRC32 0x69a74ca6 Query thread_id=13 exec_time=0 error_code=0
SET TIMESTAMP=1533484683/*!*/;
BEGIN
/*!*/;
# at 2415
#180805 23:58:03 server id 6 end_log_pos 2462 CRC32 0x2180734d Table_map: `oldboy`.`t1` mapped to number 324
# at 2462
#180805 23:58:03 server id 6 end_log_pos 2508 CRC32 0xbdcc9544 Update_rows: table id 324 flags: STMT_END_F
### UPDATE `oldboy`.`t1`
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=120 /* INT meta=0 nullable=1 is_null=0 */
# at 2508
#180805 23:58:03 server id 6 end_log_pos 2539 CRC32 0x6aceade6 Xid = 10128
COMMIT/*!*/;
# at 2539
#180806 0:02:12 server id 6 end_log_pos 2586 CRC32 0xad6d9bf8 Rotate to mysql-bin.000014 pos: 4
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;

MySQL binlog 企业案例升级版的更多相关文章

  1. MySQL mysqlbinlog企业案例

    内容待补充 案例文字说明: 7.3 故障时间点: 周四上午10点,开发人员误删除了一个表,如何恢复? 7.4 思路: 1.停业务,避免数据的二次伤害 2.找一个临时库,恢复周三23:00全备 3.截取 ...

  2. Mysql binlog应用场景与原理深度剖析

    1 基于binlog的主从复制 Mysql 5.0以后,支持通过binary log(二进制日志)以支持主从复制.复制允许将来自一个MySQL数据库服务器(master) 的数据复制到一个或多个其他M ...

  3. MySQL数据库企业集群项目实战(阶段三)

                              MySQL数据库企业集群项目实战(阶段三) 作者 刘畅 时间 2020-10-25 目录 1 架构拓扑图 1 1.1 方案一 1 1.2 方案二 2 ...

  4. MySQL Binlog Mixed模式记录成Row格式

    背景: 一个简单的主从结构,主的binlog format是Mixed模式,在执行一条简单的导入语句时,通过mysqlbinlog导出发现记录的Binlog全部变成了Row的格式(明明设置的是Mixe ...

  5. MySQL Binlog详解

    MySQL Binlog详解 Mysql的binlog日志作用是用来记录mysql内部增删改查等对mysql数据库有更新的内容的记录(对数据库的改动),对数据库的查询select或show等不会被bi ...

  6. 原创工具binlog2sql:从MySQL binlog得到你要的SQL

    从MySQL binlog得到你要的SQL.根据不同设置,你可以得到原始SQL.回滚SQL.去除主键的INSERT SQL等. 用途 数据回滚 主从切换后数据不一致的修复 从binlog生成标准SQL ...

  7. MySQL binlog中的事件类型

    MySQL binlog记录的所有操作实际上都有对应的事件类型的,譬如STATEMENT格式中的DML操作对应的是QUERY_EVENT类型,ROW格式下的DML操作对应的是ROWS_EVENT类型. ...

  8. MySQL binlog的格式解析

    我搜集到了一些资料,对理解代码比较有帮助. 在头文件中binlog_event.h中,有描述 class Log_event_header class Log_event_footer 参见[Myst ...

  9. Mysql binlog

    理解Mysql binlog 日志的三种模式   本文介绍下,mysql中binlog日志的三种模式,了解了各种模式的不同之处,才能更好地应用.有需要的朋友建议参考下.   一,模式1 Row Lev ...

随机推荐

  1. Java基础四(switch、数组、)

    1.流程控制语句switch2.数组3.随机点名器案例 ###01switch语句解构 * A:switch语句解构 * a:switch只能针对某个表达式的值作出判断,从而决定程序执行哪一段代码. ...

  2. 日志分析-mime统计

    提取日志中未落入标准字段的mime,分adx,adtype 统计mime的数量和包含js的数量占比 require 'date' require 'net/http' require 'uri' re ...

  3. MySQL--派生表Condition Pushdown优化

    如果派生表外部过滤条件可以下推到派生表内部,可以有效减少派生表内部扫描数据量和派生表使用内存甚至避免使用派生表. 如对于下面查询: SELECT * FROM ( SELECT cluster_id, ...

  4. Scala中的Map使用例子

    Map结构是一种非常常见的结构,在各种程序语言都有对应的api,由于Spark的底层语言是Scala,所以有必要来了解下Scala中的Map使用方法. (1)不可变Map特点: api不太丰富 如果是 ...

  5. Dynamic Code Evolution for Java dcevm 原理

    在hostswap dcevm中我们对Dynamic Code Evolution VM有了一个简单的了解,这篇文章将介绍Dynamic Code Evolution VM的实现原理. 有两个概念需要 ...

  6. deno学习三 官方提供的方便deno 安装方式

    早起deno 使用了golang 开发,同时需要protobuf 进行数据的序列化以及反序列化处理 当前的deno 已经使用rust 进行了开发,同时官方提供的安装方式也很方便了,不需要 那么复杂的编 ...

  7. 03C++语言对C的增强——实用性、变量检测、struct类型、C++中所有变量和函数都必须有类型、bool类型、三目运算符

    1.“实用性”增强 C语言中的变量都必须在作用域开始的位置定义,C++中更强调语言的“实用性”,所有的变量都可以在需要使用时再定义. 2.C++对c语言register的增强 register关键字 ...

  8. 集成学习之AdaBoost

    AdaBoost 当做出重要决定时,大家可能会考虑吸取多个专家而不只是一个人的意见,机器学习也是如此,这就是集成学习的基本思想.使用集成方法时有多种形式:可以是不同算法的集成,也可以是同一算法在不同设 ...

  9. 在外网访问家里面的电脑 和 DMZ

    方法1:使用 MDZ (  demilitarized zone), 中文意思 非武装的区域.我们的家用电脑一般都在 路由器所在的 C类内网(192.X.X.X 的 ip).外网是不能直接访问内网的. ...

  10. alias 创建别名

    在我们的"/home/用户名/"的目录下,会有一个“.bashrc”文件,修改步骤如下: 在文件的末尾添加: alias 想要的别名=文件路径(文件路劲加引号)例如:alias p ...