1。启用二进制日志
更改my.ini
找到[mysqld]部分,输入以下命令
#启用二进制日志
server-id = 1
log-bin = e:/mysqlbin/binlog.log
log-bin-index = e:/mysqlbin/binlog.index
重启mysql
mysql> show variables like "log_%";
+---------------------------------+----------------+
| Variable_name | Value |
+---------------------------------+----------------+
| log_bin | ON |
| log_bin_trust_function_creators | OFF |
| log_error | .\ts17-113.err |
| log_slave_updates | OFF |
| log_slow_queries | OFF |
| log_warnings | 1 |
+---------------------------------+----------------+
可以看到log_bin已经启用
e:/mysqlbin/下出现两个文件
binlog.000001
binlog.index
2。查看二进日志文件
show binary logs;
show master logs;
3.导出日志文件
mysqlbinlog -uroot -p E:\mysqlbin\binlog.000001 >d:\test.sql
参考文章
window 下 mysql 启动 二进制日志文件
http://blog.csdn.net/uvyoaa/article/details/6550685
MySQL启用二进制日志实战演示
http://database.51cto.com/art/201006/204642.htm
【mysql性能log分析工具】
http://hi.baidu.com/xhl_tips/blog/item/95de63dff2e68014495403b1.html