mysql relay-bin文件_如何配置mysql 从库自动删除localhost-relay-bin 日志文件

展开全部

您好,很高兴为您解答。

通过mysql的命e69da5e6ba903231313335323631343130323136353331333335346161令去删除mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2819416

Server version: 5.5.24-0ubuntu0.12.04.1-log (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> reset master;

Query OK, 0 rows affected (3 min 37.65 sec)

其实关键的命令就是reset master;这个命令会清空mysql-bin文件。

另外如果你的mysql服务器不需要做主从复制的话,建议通过修改my.cnf文件,来设置不生成这些文件,只要删除my.cnf中的下面一行就可以了。log-bin=mysql-bin

如果你需要复制,最好控制一下这些日志文件保留的天数,可以通过下面的配置设定日志文件保留的天数:expire_logs_days = 7

表示保留7天的日志,这样老日志会自动被清理掉。

如若满意,请点击右侧【采纳答案】,如若还有问题,请点击【追问】

希望我的回答对您有所帮助,望采纳!

~ O(∩_∩)O~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值