How to delete a mysql-bin.0000X Log File

Source: Internet
Author: User

Because of the existence of mysql-bin.0000X log files, often lead to a database file is not big but can generate a few G above the log file, the following will teach you to delete the mysql-bin.0000X log file method.

[Root @ jiucool var] #/usr/local/mysql/bin/mysql-u root-p
Enter password: (Enter the password)
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 264001
Server version: 5.1.35-log Source distribution

Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.

Mysql> reset master; (clear log files)
Query OK, 0 rows affected (8.51 sec)

Mysql>

Now, let's check the space occupied by the mysql folder?

[Root @ jiucool var] # du-h-max-depth = 1/usr/local/mysql/
37 M/usr/local/mysql/var
70 M/usr/local/mysql-test
15 M/usr/local/mysql/lib
448 K/usr/local/mysql/include
2.9 M/usr/local/mysql/share
7.6 M/usr/local/mysql/libexec
17 M/usr/local/mysql/bin
11 M/usr/local/mysql/docs
2.9 M/usr/local/mysql/SQL-Example
163 M/usr/local/mysql/

Okay. Check that the entire mysql directory occupies 16 m! OK, no problem, since the mysql-bin.0000X Log File occupies such a large space, the significance of existence is not particularly large, so we won't let it generate it.

[Root @ jiucool var] # find/-name my. cnf

Find my. cnf, which is the mysql configuration file. Comment out log-bin = mysql-bin.

# Replication Master Server (default)
# Binary logging is required for replication
# Log-bin = mysql-bin

Restart mysql.

OK, now, the delete mysql-bin.0000X log file operation is complete. It will not be because of dozens of M database size to generate N G log files.
 

Mysql Log File description

Tips for compressing MySQL Data Files

MySQL database table Representation

How to change the MySQL Data File Path

Copying a table structure in MySQL

Related Article

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.