MySQL mysqlbinlog解析出的SQL语句被注释是怎么回事

 

一网友反馈使用mysqlbinlog解析出的二进制日志中的内容中,有些SQL语句有#注释的情况,这个是怎么回事呢?我们通过实验来了解一下具体细节情况,如下所示,实验环境为5.6.20-enterprise-commercial-advanced-log

 

 

# whereis mysqlbinlog

mysqlbinlog: /usr/bin/mysqlbinlog /usr/share/man/man1/mysqlbinlog.1.gz

 

我们先在参数文件my.cnf里面设置binlog_format=ROW ,然后重启一下MySQL服务

 

 

mysql> show variables like 'binlog_format';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW   |
+---------------+-------+
1 row in set (0.00 sec)
 
mysql> show master status;
+----------------------+----------+--------------+------------------+-------------------+
| File                 | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+----------------------+----------+--------------+------------------+-------------------+
| DB-Server-bin.000005 |      512 |              |                  |                   |
+----------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
 
mysql> 
 
 
 
mysql> drop table kkk;
Query OK, 0 rows affected (0.01 sec)
 
mysql> create table kkk (id int ,name varchar(32));
Query OK, 0 rows affected (0.02 sec)
 
mysql> insert into kkk
    -> select 100, 'name' union all
    -> select 200, 'kerry' union all
    -> select 300, 'k3';
Query OK, 3 rows affected (0.02 sec)
Records: 3  Duplicates: 0  Warnings: 0
 
mysql> 

相关文章:

  • 2021-08-27
  • 2021-12-10
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2021-12-17
  • 2021-07-24
猜你喜欢
  • 2021-07-04
  • 2021-05-26
  • 2022-12-23
  • 2021-11-06
  • 2021-10-29
  • 2021-12-07
相关资源
相似解决方案