MySQL Purge Binary Logs: Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
## <tt>'''mysql> purge binary logs before 'yyyy-mm-dd hh:mm:ss''''</tt> (note: the seconds is optional)
## <tt>'''mysql> purge binary logs before 'yyyy-mm-dd hh:mm:ss''''</tt> (note: the seconds is optional)


== Further Reading ==
# [http://dev.mysql.com/doc/refman/5.5/en/purge-binary-logs.html MySQL Reference Guide - PURGE BINARY LOGS Syntax]


[[Category:MySQL]]
[[Category:MySQL]]

Revision as of 11:53, 26 July 2012

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

Further Reading

  1. MySQL Reference Guide - PURGE BINARY LOGS Syntax