开启mysql的bin-log日志

编辑 my.cnf 文件,加入:

1
log-bin=/var/lib/mysql/mysql-bin

重启mysql,登录,查看

1
show variables like '%log_bin%';

若log_bin 状态为 on,则开启成功