problem: harddrive is running out of space , since there are many files under /var/lib/mysql/binlog.*

solution:
under /var/lib/mysql there are a lot of files like:
binlog.000290
binlog.000291

Here are the steps to delete all binary logs except for the active one in MySQL 8:
#1: Connect to MySQL: mysql -u your_username -p
#2: show logs: SHOW BINARY LOGS;
#3: purge some logs: PURGE BINARY LOGS TO 'binlog.000000';

>> maybe you don't need binary logging (if one backup per day is okay for you), you can disable it:

disable binary logging:
/etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]
skip-log-bin


--------------------------
how to verify if binary logging is disabled?
--------------------------
after you disabled the binary logging and restartet the mysql service, you should get this in the console if you run a "show binary logs;":
mysql> show binary logs;
ERROR 1381 (HY000): You are not using binary logging

computer2know :: thank you for your visit :: have a nice day :: © 2024