1、查看当前状态
show global variables like "log_bin"
2、若为OFF,修改配置文件my.cnf
- Linux查看my.cnf文件位置:find /name my.cnf
- 赋予权限:chmod 755 my.cnf
- 进入编辑模式,修改my.cnf参数:vi my.cnf,Esc+i进入编辑模式
- log_bin=mysql_bin
- binlog_format=row
- server_id=大于1的整数
- binlog_row_image=full //本地mysql版本大于5.6时设置该项
3、重启mysql服务
service mysql restarts