Mysql installed in the LNMP one-click package enables Mysql logs by default. If the website reads and writes data to the database frequently, it may generate a large number of logs and occupy disk space, it is also possible that the idle space of the VPS hard disk is fully occupied and the database cannot be enabled.
The path for this tutorial is applicable to the one-click installation package environment of LNMP. For other environments, perform the operations as needed.
To disable it, perform the following operations:
1. Modify file configuration
Modify/etc/my. cnf and find the following characters
Log-bin = mysql-bin binlog_format = mixed
Note the two rows as follows:
# Log-bin = mysql-bin # binlog_format = mixed
Add the "#" comment before the two fields and save the file.
Ii. Restart Mysql to make it take effect
Service mysqld restart
Run the preceding command in SSH and restart Mysql to make the comment take effect.
3. delete logs generated before
1) log on to MYSQL
/Usr/local/mysql/bin/mysql-u root-p
Run the preceding commands by Using SSH, enter the password, and enter the MYSQL command line mode.
2) resetting an account
Reset kwxgd; # Change kwxgd to the target database name.