利用mysql事件调度定时删除binlog_MySQL

WBOY
Release: 2016-06-01 13:10:18
Original
826 people have browsed it

1 开启事件调度器:

set global event_scheduler = 1;


2 删除10天前的binlog,并设置每天检查:

create event delete_binlog on schedule every 1 day do purge master logs before date_sub(now(),interval 10 day);


3 查看时间调度器是否生成:

select * from information_schema.events;


建议在充分测试后使用

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!