Overview Today I will mainly share how to correctly delete binlog logs from MySQL database. Be careful not to force the use of rm command to clear them. Otherwise, mysq-bin.index will be disordered, which will eventually lead to the failure of the later expire-log-days configuration item. 1. View binlog log mysql> show binary logs; 2. Delete all log files before a certain log file purge binary logs to 'mysql-bin.000035'; 3. Clean up binlog logs before 2019-09-09 13:00:00 PURGE MASTER LOGS BEFORE '2019-09-09 13:00:00'; 4. Clean up binlog logs from 3 days ago PURGE MASTER LOGS BEFORE DATE_SUB(NOW( ), INTERVAL 3 DAY); --BEFORE, the date argument of the variable can be in the format 'YYYY-MM-DD hh:mm:ss'. The cleanup here refers to the files from now - 3243600s ago, which is the time when this file was last updated. --The time and file name must not be written incorrectly, especially the year in the time and the serial number in the file name, to prevent the binlog in use from being accidentally deleted! ! ! --Do not delete the binlog in use! ! ! 5. Reset all logs reset master; 6. Manually switch binlog log flush logs --or flush binary logs When you delete all binlogs one day and the database does not generate new logs, you can use manual switching to generate them. Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed explanation of primitive values and reference values in ECMAScript
>>: How to use the Linux seq command
1. CSS Box Model The box includes: margin, border...
Regarding the nginx panic problem, we first need ...
This article shares the specific code of jQuery t...
Get a deep understanding of how the Linux configu...
Table of contents Preface 👀 Start researching 🐱🏍...
1. One-click installation of Mysql script [root@u...
<br />How can I remove the scroll bar on the...
DIV background is semi-transparent, but the words ...
A root routing component (the root routing compon...
Note: This method is only applicable to webkit-ba...
To replace a string, we need to use the following...
Put your own web project in the webapps directory...
1》Be good at web design 2》Know how to design web p...
To set the line spacing of <p></p>, us...
1. Introduction The difference between row locks ...