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
