binglog清理
查看binlog
MySQL [(none)]> show binary logs;
+------------------+------------+
| Log_name | File_size |
+------------------+------------+
| mysql-bin.000246 | 1073742039 |
| mysql-bin.000247 | 1073742006 |
| mysql-bin.000248 | 161823524 |
+------------------+------------+
3 rows in set (0.00 sec)
自动删除
MySQL [(none)]> set global expire_logs_days=1;
Query OK, 0 rows affected (0.00 sec)
手动删除
MySQL [(none)]> purge binary logs to 'mysql-bin.000246';
or
MySQL [(none)]> purge master logs to 'mysql-bin.000246';
Query OK, 0 rows affected (4.53 sec)