zoukankan      html  css  js  c++  java
  • mysql清理binlog

    v-lhb-db03:/data01/mysqllog/binlog# mysql -uroot -p1234567
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql> PURGE BINARY LOGS TO  'mysql-bin.000001';
    Query OK, 0 rows affected (0.02 sec)
    
    mysql> quit
    Bye
    
    
    
    v-lhb-db03:/data01/mysqllog/binlog# cat mysql-bin.index 
    /data01/mysqllog/binlog/mysql-bin.000001
    /data01/mysqllog/binlog/mysql-bin.000002
    /data01/mysqllog/binlog/mysql-bin.000003
    /data01/mysqllog/binlog/mysql-bin.000004
    /data01/mysqllog/binlog/mysql-bin.000005
    /data01/mysqllog/binlog/mysql-bin.000006
    v-lhb-db03:/data01/mysqllog/binlog# ls -ltr
    total 224216
    -rw-rw---- 1 mysql mysql       120 Apr 29 15:48 mysql-bin.000001
    -rw-rw---- 1 mysql mysql 229565040 Jun  2 09:28 mysql-bin.000002
    -rw-rw---- 1 mysql mysql       120 Jun  2 10:05 mysql-bin.000003
    -rw-rw---- 1 mysql mysql       143 Jun  2 10:05 mysql-bin.000004
    -rw-rw---- 1 mysql mysql       143 Jun  2 10:25 mysql-bin.000005
    -rw-rw---- 1 mysql mysql       120 Jun  2 13:28 mysql-bin.000006
    -rw-rw---- 1 mysql mysql       246 Jun  2 15:09 mysql-bin.index
    
    v-lhb-db03:/data01/mysqllog/binlog# mysql -uroot -p1234567
    
    
    mysql> PURGE BINARY LOGS TO  'mysql-bin.000002';
    Query OK, 0 rows affected (0.01 sec)
    
    mysql> quit
    Bye
    v-lhb-db03:/data01/mysqllog/binlog# ls -ltr
    total 224212
    -rw-rw---- 1 mysql mysql 229565040 Jun  2 09:28 mysql-bin.000002
    -rw-rw---- 1 mysql mysql       120 Jun  2 10:05 mysql-bin.000003
    -rw-rw---- 1 mysql mysql       143 Jun  2 10:05 mysql-bin.000004
    -rw-rw---- 1 mysql mysql       143 Jun  2 10:25 mysql-bin.000005
    -rw-rw---- 1 mysql mysql       120 Jun  2 13:28 mysql-bin.000006
    -rw-rw---- 1 mysql mysql       205 Jun  2 15:10 mysql-bin.index
    v-lhb-db03:/data01/mysqllog/binlog# cat mysql-bin.index 
    /data01/mysqllog/binlog/mysql-bin.000002
    /data01/mysqllog/binlog/mysql-bin.000003
    /data01/mysqllog/binlog/mysql-bin.000004
    /data01/mysqllog/binlog/mysql-bin.000005
    /data01/mysqllog/binlog/mysql-bin.000006
    v-lhb-db03:/data01/mysqllog/binlog# 
    
    
    PURGE {MASTER | BINARY} LOGS TO 'log_name'
    PURGE {MASTER | BINARY} LOGS BEFORE 'date'
    Deletes all the binary logs listed in the log index prior to the
    specified log or date. The logs also are removed from the list recorded
    in the log index file, so that the given log becomes the first.
    This statement has no effect if the --log-bin option has not been
    enabled.

  • 相关阅读:
    CEAC认证
    CEAC认证
    java 和.net 开发平台的感受(菜鸟级)
    NBA现场直播在线看
    NBA现场直播在线看
    CEAC认证
    NBA现场直播在线看
    NBA现场直播在线看
    选择冒泡排序
    折半查找法
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351637.html
Copyright © 2011-2022 走看看