编辑my.ini或者my.cnf文件
清空binlog信息
- #查看现存的binlog文件列表
- show master logs;
- #重置清空binlog文件
- reset master;
- #重置清空后 重新查看现存的binlog文件列表 是否都被清空了
- show master logs;
复制代码 停用binlog功能
为啥要关闭binlog功能呢?
是因为反正是个测试服务器,磁盘比较小。无所谓数据丢不丢的。但是不建议生产环境关闭,这可能会造成非常严重的灾难。
在mysqld分组下面加skip-log-bin配置然后重启数据库即可
重启后查询log_bin状态。返回log_bin为OFF表示binlog日志功能为停用状态。如果这里为ON表示启用中。- show variables like 'log_bin';
- +---------------+-------+
- | Variable_name | Value |
- +---------------+-------+
- | log_bin | OFF |
- +---------------+-------+
- 1 row in set (0.01 sec)
- #重新查看binlog文件列表 返回错误了 就对了
- show master logs;
- ERROR 1381 (HY000): You are not using binary logging
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |