MySQL Purge Binary Logs: Difference between revisions
Jump to navigation
Jump to search
(Created page with "# Change to the directory containing the binary log files. # Flush the logs ## <tt>'''# mysqladmin flush-logs -p -uroot'''</tt>") |
No edit summary |
||
Line 1: | Line 1: | ||
# Change to the directory containing the binary log files. | # Change to the directory containing the binary log files. | ||
# Flush the logs | ## Note the last time on the first to newest mysql-bin.######, use that time for the purge binary logs before command. | ||
# Flush the logs. | |||
## <tt>'''# mysqladmin flush-logs -p -uroot'''</tt> | ## <tt>'''# mysqladmin flush-logs -p -uroot'''</tt> | ||
# Login to MySQL. | |||
## <tt>'''mysql -p -uroot'''</tt> | |||
# Purge the binary logs. | |||
## <tt>'''mysql> purge binary logs before 'yyyy-mm-dd hh:mm:ss''''</tt> (note: the seconds is optional) | |||
[[Category:MySQL]] |
Revision as of 11:51, 26 July 2012
- 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)