Utilitaires
Scripts
Divers
Jeux
Rechercher
Quillevere.net
Computer techniques

Avoid too large MySQL logs

27/02/2017

You can quickly have your hard drive flooded with files mysql-bin.xxxxxx (mysql-bin.000001...). These files are MySQL logs which trace all the modifications to the database.It is best to disable them by modifying the my.ini file and adding this in the mysqldd section:

[mysqld]
innodb_stats_on_metadata=OFF

By restarting the MySQL server, the log files will be automatically deleted.

Binlog files on MySQL 8

On MySQL 8, binlog.xxxxxx files can take up a lot of space. Here's how to purge them.

First, run the following query to indicate if the binary logs are active and display the files already present:

SHOW BINARY LOGS

Then run the purge of these files in MySQL:

PURGE BINARY LOGS BEFORE NOW()

To avoid creating new ones, modify your configuration file:

nano /etc/mysql/my.cnf

Then add the following part:

[mysqld]
disable_log_bin

Then restart the MySQL server to take this change into account.

Dernière modification le 03/01/2019 - Quillevere.net

Commentaires

No inscription needed if you wish to

Search in this website

fr en rss RSS info Informations