MySQL Purge Binary Logs
Jump to navigation
Jump to search
- Change to the directory containing the binary log files.
- Note the last time on the first to newest mysql-bin.######, use that time for the purge binary logs before command.
- Flush the logs.
- # mysqladmin flush-logs -p -uroot
- Login to MySQL.
- mysql -p -uroot
- Purge the binary logs.
- mysql> purge binary logs before 'yyyy-mm-dd hh:mm:ss' (note: the seconds is optional)