Home >Database >Mysql Tutorial >3 ways to clear binlog in MySQL!

3 ways to clear binlog in MySQL!

黄舟
黄舟Original
2017-02-18 11:08:192542browse


-- mysql delete log online

1 mysql command purge

mysql> purge master logs to "mysql-bin.000410";
Query OK, 0 rows affected (3.71 sec)

2 Manual rm cleanup

rm -rf mysql-bin.00040*;
vim mysql-bin.log.index

Purge Remove the mysql-bin.0004** record inside

3 Parameter cleanup

set global expire_logs_days=5;

System automatic cleanup

The above are 3 in MySQL How to clear binlog! Contents, please pay attention to the PHP Chinese website (www.php.cn) for more related content!


Statement:
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