MySQL 慢日志迁移后没有自动创建新的日志文件记录

问题:

MySQL5.6/5.7/8.0把慢日志mv迁移到其他路径后没有自动创建新的log文件,本地新建文件也无法打印慢日志

 

状态:

mysql实例运行正常,没有看到error log,慢日志配置正常,采集时间正常,范围正常;

 

解决:

再数据库上执行刷新操作,命令:

flush logs

 

原因:

需要刷新缓存

 

注意事项:

不需要重启数据库,不需要手动创建日志文件,刷新后mysql会自动创建日志文件,但是迁移后到执行刷新的这段时间的慢日志已丢失无法找回;

 

官方原文:

FLUSH LOGS

Closes and reopens any log file to which the server is writing. If binary logging is enabled, the sequence number of the binary log file is incremented by one relative to the previous file. If relay logging is enabled, the sequence number of the relay log file is incremented by one relative to the previous file.

 

地址:

https://dev.mysql.com/doc/refman/5.7/en/flush.html

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值