GeekIBLi

mysql配置binlog

2021-07-05

开启binlog

[mysqld]
log-bin=mysql-bin #添加这一行就ok
binlog-format=ROW #选择row模式
server_id=1 #配置mysql replaction需要定义,不能和canal的slaveId重复

查看binlog状态

mysql> show variables like ‘binlog_format’;

1
2
3
4
5
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW |
+---------------+-------+

show variables like ‘log_bin’;

1
2
3
4
5
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin | ON |
+---------------+-------+
Tags: MySQL