본문 바로가기
IT

db log 파일 삭제

by Oh.mogilalia 2018. 5. 8.

root@mogibu:/# mysql -uroot -p

Enter password: 

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 11

Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04


Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.


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


MariaDB [(none)]> show binary logs;

+--------------------+-----------+

| Log_name           | File_size |

+--------------------+-----------+

| mariadb-bin.000054 |    264905 |

| mariadb-bin.000055 |   2028089 |

| mariadb-bin.000056 |    103614 |

| mariadb-bin.000057 |     74992 |

| mariadb-bin.000058 |       328 |

| mariadb-bin.000059 |    351728 |

| mariadb-bin.000060 |     50983 |

| mariadb-bin.000061 |    235351 |

| mariadb-bin.000062 |    348638 |

| mariadb-bin.000063 |   2650713 |

| mariadb-bin.000064 |    459030 |

| mariadb-bin.000065 |    841284 |

| mariadb-bin.000066 |     59236 |

| mariadb-bin.000067 |       347 |

| mariadb-bin.000068 |   1155556 |

| mariadb-bin.000069 |    314072 |

| mariadb-bin.000070 |    140774 |

| mariadb-bin.000071 |      4675 |

| mariadb-bin.000072 |     36695 |

| mariadb-bin.000073 |    107219 |

| mariadb-bin.000074 |   9495052 |

| mariadb-bin.000075 |   1060817 |

| mariadb-bin.000076 |    757067 |

| mariadb-bin.000077 |     80388 |

| mariadb-bin.000078 |    332421 |

| mariadb-bin.000079 |    450583 |

| mariadb-bin.000080 |    711126 |

| mariadb-bin.000081 |   1967140 |

| mariadb-bin.000082 |    714606 |

| mariadb-bin.000083 |      3729 |

| mariadb-bin.000084 |   2890013 |

| mariadb-bin.000085 |       347 |

| mariadb-bin.000086 |     29918 |

+--------------------+-----------+

33 rows in set (0.00 sec)


MariaDB [(none)]> PURGE BINARY LOGS BEFORE '2018-05-01 00:00:00';

Query OK, 0 rows affected (0.01 sec)


MariaDB [(none)]> show binary logs;

+--------------------+-----------+

| Log_name           | File_size |

+--------------------+-----------+

| mariadb-bin.000065 |    841284 |

| mariadb-bin.000066 |     59236 |

| mariadb-bin.000067 |       347 |

| mariadb-bin.000068 |   1155556 |

| mariadb-bin.000069 |    314072 |

| mariadb-bin.000070 |    140774 |

| mariadb-bin.000071 |      4675 |

| mariadb-bin.000072 |     36695 |

| mariadb-bin.000073 |    107219 |

| mariadb-bin.000074 |   9495052 |

| mariadb-bin.000075 |   1060817 |

| mariadb-bin.000076 |    757067 |

| mariadb-bin.000077 |     80388 |

| mariadb-bin.000078 |    332421 |

| mariadb-bin.000079 |    450583 |

| mariadb-bin.000080 |    711126 |

| mariadb-bin.000081 |   1967140 |

| mariadb-bin.000082 |    714606 |

| mariadb-bin.000083 |      3729 |

| mariadb-bin.000084 |   2890013 |

| mariadb-bin.000085 |       347 |

| mariadb-bin.000086 |     29918 |

+--------------------+-----------+

22 rows in set (0.00 sec)


MariaDB [(none)]> PURGE BINARY LOGS BEFORE '2018-05-05 00:00:00';

Query OK, 0 rows affected (0.01 sec)


MariaDB [(none)]> show binary logs;

+--------------------+-----------+

| Log_name           | File_size |

+--------------------+-----------+

| mariadb-bin.000076 |    757067 |

| mariadb-bin.000077 |     80388 |

| mariadb-bin.000078 |    332421 |

| mariadb-bin.000079 |    450583 |

| mariadb-bin.000080 |    711126 |

| mariadb-bin.000081 |   1967140 |

| mariadb-bin.000082 |    714606 |

| mariadb-bin.000083 |      3729 |

| mariadb-bin.000084 |   2890013 |

| mariadb-bin.000085 |       347 |

| mariadb-bin.000086 |     29918 |

+--------------------+-----------+

11 rows in set (0.00 sec)


MariaDB [(none)]> PURGE BINARY LOGS BEFORE '2018-05-06 00:00:00';

Query OK, 0 rows affected (0.01 sec)


MariaDB [(none)]> show binary logs;

+--------------------+-----------+

| Log_name           | File_size |

+--------------------+-----------+

| mariadb-bin.000079 |    450583 |

| mariadb-bin.000080 |    711126 |

| mariadb-bin.000081 |   1967140 |

| mariadb-bin.000082 |    714606 |

| mariadb-bin.000083 |      3729 |

| mariadb-bin.000084 |   2890013 |

| mariadb-bin.000085 |       347 |

| mariadb-bin.000086 |     29918 |

+--------------------+-----------+

8 rows in set (0.00 sec)


MariaDB [(none)]> exit;

Bye

root@mogibu:/# 


'IT' 카테고리의 다른 글

plex media server 백업 제외  (0) 2018.05.09
우분투 서버 커널 업그레이드  (1) 2018.05.09
디렉토리별 용량체크  (0) 2018.05.08
Linux 디렉토리 구조 [퍼옴]  (0) 2018.05.08
우분투 서버 캐쉬메모리 비우기  (0) 2018.05.07