MySQL Bin Files Memakan Banyak Space Hardisk Server
  Admin   25 Agustus 2019   fix error

Disable MySQL binlogging

If you are not replicating, you can disable binlogging by changing your my.ini or my.cnf file. Open your my.ini or /etc/my.cnf (/etc/mysql/my.cnf), enter:
# vi /etc/my.cnf
Find a line that reads “log_bin” and remove or comment it as follows:

#log_bin                        = /var/log/mysql/mysql-bin.log

You also need to remove or comment following lines:

#expire_logs_days        = 10
#max_binlog_size         = 100M

Close and save the file. Finally, restart mysql server:
# service mysql restart


Purge Master Logs

If you ARE replicating, then you need to periodically RESET MASTER or PURGE MASTER LOGS to clear out the old logs as those files are necessary for the proper operation of replication. Use following command to purge master logs:

$ mysql -u root -p 'MyPassword' -e "PURGE BINARY LOGS TO 'mysql-bin.03';"


$ mysql -u root -p 'MyPassword' -e "PURGE BINARY LOGS BEFORE '2008-12-15 10:06:06';"

Tags :

mysql , ubuntu

Bagikan :