How to disable MySQL logs

Source: Internet
Author: User

This article introduces how to disable mysql logs. This article applies to linux, lamp, and windows systems. For more information, see.

Specify the log output location in the configuration file.

Windows: the configuration file for Windows is my. ini, which is usually in the MySQL installation directory or c: Windows.
Linux: the configuration file of Linux is my. cnf, which is usually in/etc.


You can also run the following command to check the path (if it is 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 lot of large files named mysql-bin.000014, it means you also need to close the log file, because you don't know which day they will fill up your VPS hard disk.

Use WINSCP to delete these files.

How to disable:

The Code is as follows: Copy code

Vi/etc/my. cnf

Find:

The Code is as follows: Copy code

Log-bin = mysql-bin
Binlog_format = mixed

Comment out the two lines, and add #
Save the settings.
Run the following command to restart LNMP. Close.

The Code is as follows: Copy code

/Root/lnmp restart

There is another way in linux


Disable mysql Logging

1. Go to mysql

The Code is as follows: Copy code

[Root @ localhost ~] # Mysql-u root-p
Enter password:

2. view log files

The Code is as follows: Copy code

Mysql> show master logs;

There will be a lot of mysql-bin.0000 * files Oh these are log files

NOTE: If ERROR 1381 (HY000): You are not using binary logging occurs, your log file is closed.

3. Close the mysql Log File

The Code is as follows: Copy code

Mysql> reset master; // disable logs

Mysql> show master logs; // check whether logs exist.

Mysql> exit;
Bye

4. Modify the mysql configuration file my. cnf. Find log-bin = mysql-bin and binlog_format = mixed and add comments to the front.

5. Restart mysql OK.

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.