Mariadb (MySQL)开启binlog

Mariadb (MySQL)开启binlog

检查binlog开启状况

MariaDB [(none)]> show variables like 'log_%'\G
*************************** 1. row ***************************
Variable_name: log_bin
        Value: OFF
...

修改mariadb配置

vim /etc/mysql/mariadb.conf.d/50-server.cnf

log_bin                     = /var/lib/mysql/mysql-bin.log
log_bin_index               = /var/lib/mysql/mysql-bin.index
expire_logs_days            = 10
max_binlog_size             = 100M
binlog_format	 	        = ROW

重启数据库

systemctl restart mysql