Clear and disable MySQL Binarylogs_MySQL-mysql tutorials

Source: Internet
Author: User
Clear and disable Binarylogs bitsCN.com of MySQL

Clear and disable Binary logs of MySQL

Recently, MySQL has suddenly flown in. Binary Log eats more than 800 MiB of hard disk space, which interferes with the normal operation of the system. There are many solutions, including directly deleting files and clearing logs one by one using SQL statements. However, I still prefer to use standard operations.

Turn it off

Edit/etc/mysql/my. cnf, locate the log-bin option, and comment it out. if expire_logs_days expire_cnf exists, comment it out.

...# log-bin# expire_logs_days = 10...

Clear existing logs

First, use mysql-u root-p to log on to the server.

SHOW BINARY LOGS;

First, let's take a look at how many logs we have and how much space we have. There are so many.

+-------------------+-----------+| Log_name          | File_size |+-------------------+-----------+| mysqld-bin.000001 |       264 || mysqld-bin.000002 |      1546 || mysqld-bin.000003 |     11728 || mysqld-bin.000004 | 122291346 || mysqld-bin.000005 |       264 || mysqld-bin.000006 |       958 || mysqld-bin.000007 |     85263 || mysqld-bin.000008 |    467392 || mysqld-bin.000009 |    271736 || mysqld-bin.000010 |       264 || mysqld-bin.000011 |      2670 || mysqld-bin.000012 |   5258576 || mysqld-bin.000013 |     25406 || mysqld-bin.000014 |    430000 || mysqld-bin.000015 |    560172 || mysqld-bin.000016 |  45971600 || mysqld-bin.000017 |  62227475 || mysqld-bin.000018 | 223992121 || mysqld-bin.000019 |  91294894 || mysqld-bin.000020 |   4796916 |+-------------------+-----------+FLUSH LOGS;RESET MASTER;

So far, Binary Logs has been permanently disabled.

BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.