MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 3023|回复: 1
打印 上一主题 下一主题

[参数配置] 配置了bin_log但binlog中没有操作记录

[复制链接]
跳转到指定楼层
1#
发表于 2015-10-9 09:41:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 sjip008 于 2015-10-9 09:42 编辑

操作系统:contos 7
mysql:5.6.26 mysql community server (GPL)
对数据库进行操作 但binlog中没有操作日志 。下面有具体操作。
日志记录
mysql> show variables like '%log_bin';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin       | ON    |
| sql_log_bin   | ON    |
+---------------+-------+
2 rows in set (0.00 sec)


mysql> show master status;
+----------------+----------+--------------+------------------+-------------------+
| File           | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+----------------+----------+--------------+------------------+-------------------+
| log-bin.000011 |      120 | tpceshi      |                  |                   |
+----------------+----------+--------------+------------------+-------------------+


mysql> use cpceshi
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>
mysql>
mysql> show tables;
+-------------------+
| Tables_in_cpceshi |
+-------------------+
| hello             |
+-------------------+
1 row in set (0.00 sec)

mysql> insert into hello values(3,'aaa');
Query OK, 1 row affected (0.00 sec)

mysql> select * from hello;
+------+----------+
| id   | name     |
+------+----------+
|    1 | hsq      |
|    2 | xiaoming |
|    3 | aaa      |
+------+----------+
3 rows in set (0.00 sec)


但是进入log-bin.000011没有相关操作日志 这是为啥有点无语。。。怎么排查错误?
附加log-bin.000011日志
[root@localhost ~]# mysqlbinlog /var/lib/mysql/log-bin.000011  
/*!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
#151009  9:21:28 server id 1  end_log_pos 120 CRC32 0x2a379c9f         Start: binlog v 4, server v 5.6.26-log created 151009  9:21:28 at startup
# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
BINLOG '
mBYXVg8BAAAAdAAAAHgAAAABAAQANS42LjI2LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACYFhdWEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAZ+c
Nyo=
'/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;

附加 my.cnf参数配置
[root@localhost ~]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/ ... ation-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

#主从新添加的内容
port=3306
log-bin=log-bin
server-id=1
expire-logs-days = 7
##binlog-do-db=hsq
#binlog-ignore-db=mysql
binlog-do-db=tpceshi




[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid





分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享淘帖 顶 踩
2#
发表于 2015-10-10 11:14:47 | 只看该作者
BINLOG '
mBYXVg8BAAAAdAAAAHgAAAABAAQANS42LjI2LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACYFhdWEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAZ+c
Nyo=

这种就是数据,你需要解析下binlog才能看到...
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-4-19 11:27 , Processed in 0.068483 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表