Mysql日常维护篇(一)

1、在windows环境下的mysql如何清理binlog

C:\Users\Administrator>mysql -hlocalhost -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 381
Server version: 5.6.32-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
mysql>show master logs;


| 128-bin.001145 | 1074357292 |
| 128-bin.001146 | 1074696890 |
| 128-bin.001147 | 1074215454 |
| 128-bin.001148 | 1092914225 |
| 128-bin.001149 | 1073746978 |
| 128-bin.001150 |  588319122 |
+----------------+------------+
1150 rows in set (0.09 sec)

mysql>



purge binary logs to '128-bin.001000';



PURGE MASTER LOGS TO '128-bin.001000′;
PURGE MASTER LOGS BEFORE '2008-06-22 13:00:00′;

 

posted @ 2019-07-25 09:56  dayu.liu  阅读(640)  评论(0编辑  收藏  举报