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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
Security Latest
Security Latest
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
S
Secure Thoughts
PCI Perspectives
PCI Perspectives
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
GbyAI
GbyAI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
罗磊的独立博客
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
V
V2EX
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tenable Blog
T
Threat Research - Cisco Blogs
T
Troy Hunt's Blog
V2EX - 技术
V2EX - 技术
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
Lohrmann on Cybersecurity
F
Full Disclosure
H
Help Net Security
博客园 - Franky
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
A
Arctic Wolf
O
OpenAI News
S
Securelist

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