查看binlog
【查看binlog】
show variables like '%log_bin%'; +---------------------------------+--------------------------+ | Variable_name | Value | +---------------------------------+--------------------------+ | log_bin | ON | | log_bin_basename | /data/mysql/binlog | | log_bin_index | /data/mysql/binlog.index | | log_bin_trust_function_creators | OFF | | log_bin_use_v1_row_events | OFF | | sql_log_bin | ON | +---------------------------------+--------------------------+
show binlog events in "binlog.000017";
【通过mysqlbinlog】
[遇到的问题]
mysqlbinlog: [ERROR] unknown variable 'default-character-set=utf8mb4'
mysqlbinlog是二进制日志查看工具,其也会读取/etc/my.cnf中 [client] 段的配置,但是不识别编码
解决方法
1) 将[client]中 default_character_set=utf8mb4注释
mysqlbinlog -d db1 /data/mysql/binlog.000002
[参考]
https://www.cnblogs.com/dissipate/p/14230822.html