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;

转载于:https://www.cnblogs.com/handle/p/9761702.html

你可能感兴趣的:(Mysql是否开启binlog日志&开启方法)