Purge MYSQL Binary Logs On TMG
From TBwiki
Revision as of 09:55, 9 July 2015 by Nicole Tan (Talk | contribs)
This page shows how to manually
Contents |
Verify your hard disk space
MYSQL binlogs location
Purge unnecessary binlogs
1. Access mysql database mysql -u user –ppassword e.g. mysql -u tbdb –ptbdbpw
2. Execute the Purge command: Examples: To erase all binlogs before a specific binlog file: PURGE BINARY LOGS TO 'mysql-bin.010'; To erase all binlogs before a specific Date/Time: PURGE BINARY LOGS BEFORE '2015-04-02 22:46:26';
Expire binary log files automatically
You can also set the expire_logs_days system variable to expire binary log files automatically after a given number of days. Simply add this to /etc/my.cnf
[mysqld] expire-logs-days=60
Note: a 60 days rotation log is enabled by default in more recent TB products.
Restart mysql
Then mysqld will delete them for you automatically