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.