mysql开启日志

mysql开启sql日志

#查看日期情况
#show variables like '%general%';
#开启日志
#SET GLOBAL general_log = 'On';
#指定日志文件
#SET GLOBAL general_log_file = '/var/lib/mysql/mysql.log';
 

mysql开启binlog日志

show variables like 'log_%';

 修改/etc/my.cnf文件,在配置文件[mysqld]下增加如下配置:

server-id=123
log-bin=mysql-bin
binlog_format=ROW

重启mysql

systemctl restart mysql

再次查看binlog日志是否开启:


原文地址:https://www.cnblogs.com/chong-zuo3322/p/14551146.html