Mysql是否开启binlog日志&开启方法
运行sql show variables like 'log_bin';
如果Value 为 OFF 则未开启日志文件
如何开启mysql日志?
找到my,cnf 中 [mysqld] 添加如下
[mysqld]
# binlog 配置
log-bin = /usr/local/var/mysql/logs/mysql-bin.log
expire-logs-days = 14
max-binlog-size = 500M
server-id = 1
如果没有my.cnf 或者是集成的环境 找到my.ini 中 [mysqld] 添加如下
[mysqld]
# binlog 配置
log-bin = /usr/local/var/mysql/logs/mysql-bin.log
expire-logs-days = 14
max-binlog-size = 500M
server-id = 1
重启mysql后 show variables like 'log_bin'; Value 为 ON即可
查询binlog 变动信息 show binlog events;
如果本文章已帮助到您!