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

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

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个机房按小时计费,支持支付宝,【点击查看】。