Close the MySQL log method detailed

Source: Internet
Author: User
Tags mixed

Specify the location of the log in the configuration file.

The windows:windows configuration file is My.ini, usually under the MySQL installation directory or c:windows.
The Linux:linux configuration file is my.cnf, usually under/etc.


You can also use the following command to check (if not lnmp, the path may be different):

The code is as follows Copy Code

Du-h--max-depth=1/usr/local/mysql/var/*

If you see a large number of large files, and named mysql-bin.000014, you also need to close the log file, because you do not know which day they will put your VPS hard drive full.

Use WinSCP to remove these files.

How to close:

The code is as follows Copy Code

Vi/etc/my.cnf

Found it:

The code is as follows Copy Code

Log-bin=mysql-bin
Binlog_format=mixed

Comment out these two lines and precede with #
and then save.
Finally, use the following instructions to restart the next lnmp. Wrap

The code is as follows Copy Code

/ROOT/LNMP restart

There's another way in Linux


turn off the MySQL log feature

1, in MySQL

The code is as follows Copy Code

[Root@localhost ~]# mysql-u root-p
Enter Password:

2. View Log file

The code is as follows Copy Code

Mysql> show master logs;

There will be a lot of mysql-bin.0000* files. These are all log files,

Note: If error 1381 (HY000) is present: You are the not using binary logging means your log file is closed.

3. Close MySQL log file

The code is as follows Copy Code

mysql> Reset Master; Close Log

Mysql> show master logs; See if there are any more logs

Mysql> exit;
Bye

4, modify the MySQL configuration file my.cnf. Find Log-bin=mysql-bin, binlog_format=mixed in front of the comment can

5. Restart MySQL OK

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.