在/etc/my.cnf文件中【mysqld】下加上:
server-id = 1 (在整个Mysql集群中保证唯一)
log-bin = binlog
log-bin-index = binlog.index
重启Mysql:
MYSQL启用和查看二进制日志
查看是否启用了日志
mysql>show variables like 'log_bin';
查看当前的日志
mysql> show master status;
看二进制日志文件用mysqlbinlog
shell>mysqlbinlog mail-bin.000001
查看表结构
show columns from tables;