1, 编辑/etc/mysql/mysql.cnf文件,在后面加上配置参数
#binlog configuration by myself
log_bin=/var/log/mysql/binlog
server_id=100
2, 重启mysql
systemctl stop mysql.service
systemctl start mysql.service
3, 查询二进制日志
使用root@jayubuntu:/var/log/mysql# mysqlbinlog --no-defaults binlog.000004
或者: