1. add a my.ini file in the installation folder(windos), the content is as below
log-bin="D:/mysql-5.6.21-winx64/data/binlog/bin-log"
binlog-format=MIXED
2. the above content has enabled the binary log, it also set the log format
3. stop the mysql with below command
bin\mysqladmin.ext -u root -p shutdown
4. launch the mysql
bin\mysqld.exe
5. check mysql binary log status with mysql client
bin\mysql.exe
show master logs
show variables like '%binlog%'
6. export mysql
bin\mysqldump -u root -p --single-transaction --flush-logs --all-database --master-data=2 > mysql_full_duml.sql
7. check mysql version
select version();
MySQL二进制日志配置与导出
本文介绍如何通过编辑MySQL配置文件启用二进制日志功能,并设置其格式为MIXED。此外还提供了停止及启动MySQL服务的方法,并展示了如何检查二进制日志的状态。最后给出了使用mysqldump命令进行数据库完整备份的步骤。
2222

被折叠的 条评论
为什么被折叠?



