查看是否开启binloq: show variables like 'log bing'; 开启binlog: log-bin="LAPTOP-7FRIEVH7-bin 关闭binlog: skip-log-bin 生成新的binlog文件: 方式一:重启mysq1服务使用命令 flush logs 方式二:查看binlogshow binlog events in 'ECS-56099351-bin.00001'; 将binlog日志并转为文本形式: mysqlbinlog -v --set-charset=utf8 LAPTOP-7ERIEVH7-bin.000001 > binlog.txt 说明:-v 用于显示伪SQL语句 数据恢复: mysglbinlog --no-defaults --start-psition-1089 --tp-position=1220 IAPTOP-7ERIEVH7-bin,0001 mysgl.exe -uroot -pl23456 注意:应该选择BEGIN 、COMMIT 之间的区域标签:bin,binlog,log,--,7ERIEVH7,命令,mysql From: https://www.cnblogs.com/songweipeng/p/17922035.html