惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

Rat's Blog - MySQL

一个强大的数据库管理工具:Navicat Premium中文破解版 - Rat's Blog CentOS 7安装配置Nginx 1.10、PHP 5.6、MySQL 5.7教程 Database.NET:一个好用的多数据库管理工具 - Rat's Blog 一个简单的MySQL备份bash脚本,直接发送到邮箱 - Rat's Blog 修改phpMyAdmin导入MySQL数据库文件大小限制 - Rat's Blog 使用Mysqldump备份数据库出现when using LOCK TABLES解决方法 - Rat's Blog Linux修改PhpMyAdmin(MySql)密码教程 - Rat's Blog 使用Mysqldump备份和还原MySQL数据库 - Rat's Blog VPS登陆phpMyAdmin出现"#2002 无法登录 MySQL 服务器"错误的解决方法 - Rat's Blog
LNMP删除和关闭Mysql日志 - Rat's Blog
博主: Rat's · 2016-05-18 · via Rat's Blog - MySQL

说明:一般mysql会生成一堆的mysql.bin.*的一堆的日志,针对我们这种小网站来说,确实没什么实际大的用处,还有可能塞满我们的硬盘。一般情况下,很多人都会选择关了它,反正有每个小时的mysqldump导出记录备档。

方法

删除Mysql日志
第一、日志文件地址

/usr/local/mysql/var/

在上面的文件夹中,有几M到几个G不等,我们也不要急于全部删除,可以选择几个大的删除就可以。

第二、重启MYSQL

/etc/init.d/mysql restart

关闭Mysql日志
第一、找到文件 /etc/my.cnf 注释下面2行文件:

#log-bin=mysql-bin
#binlog_format=mixed

当然,如果你非要留着,也可以缩短日志的保存时间,默认是10天。

expire_logs_days = 10 #修改此项即可

第二、重启MYSQL

/etc/init.d/mysql restart

版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/29/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。