centos mysql 删除日志及关闭日志

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天的日志,旧日志会自动被清理掉。

 



上一篇: CSS3 Filter详解(改变模糊度 亮度 透明度等方法)
下一篇: php高效遍历目录文件及子目录
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: centos lnmp
相关日志:
评论: 0 | 引用: 0 | 查看次数: 394
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 邮件地址支持Gravatar头像,邮箱地址不会公开.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭

 广告位

↑返回顶部↑