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
illustrate: VMware IOInsight is a tool that helps...
1. Install Howdy: howdy project address sudo add-...
1. Uninstall npm first sudo npm uninstall npm -g ...
How to use the concat function in MySQL: CONCAT(s...
1. Create a new UI project First of all, our UI i...
Permission denied: The reason for this is: there ...
Question: What is the difference between int(1) a...
Nginx supports three ways to configure virtual ho...
Table of contents Mixins implementation Hook func...
Table of contents Vue first screen performance op...
Table of contents 1. Preprocessing 2. Compilation...
Table of contents Event Loop miscroTask (microtas...
1. Installation apt-get install mysql-server requ...
Anchor tag usage: Linking to a specific location i...
When playing music, the lyrics will gradually fil...