Windows Server MySQL log file cleanup simple method

Source: Internet
Author: User
Tags ini reset

What file is mysql-bin.0000x?

MYSQL-BIN.000001, Files such as mysql-bin.000002 are database operations logs, such as update a table, or delete some data, even if the statement does not have matching data, this command will also be stored in the log file, including the time of each statement execution, will also be recorded.

What is the use of

mysql-bin.00000x log file is a very simple to record our MySQL log file, we can use it to ensure MySQL data integrity, if the database problem, and you have a backup before, then you can look at the log file, find out which command caused your database problem, find a way to recover the loss

Another role is to synchronize data between the master and slave servers

All operations on the primary server are in the logging log, which can be done from the server to ensure that two synchronizations

MySQL log file cleanup

Operation Log of database

mysql-bin.000001

mysql-bin.000002

mysql-bin.000003

Wait, a lot of log files are more than 10 g. My MySQL total database adds up to less than 1G

These can be cleaned out.

Enter Mysql-u root-p and enter the password

Enter reset master after successful entry;

mysql> Reset Master;

Query OK, 0 rows affected, 1 warning (0.20 sec)

You can empty the MySQL log, the world is refreshing ...

If you don't want the MySQL log to be closed in My.ini

Find My.ini, open it, find Log-bin=mysql-bin, and then comment it out.

#log-bin=mysql-bin

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.