You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "hezyin (via GitHub)" <gi...@apache.org> on 2023/03/23 01:39:33 UTC

[GitHub] [incubator-devlake-website] hezyin commented on a diff in pull request #469: add mysql troubleshooting

hezyin commented on code in PR #469:
URL: https://github.com/apache/incubator-devlake-website/pull/469#discussion_r1145579408


##########
docs/Troubleshooting/MySqlSizeIssue.md:
##########
@@ -0,0 +1,36 @@
+---
+title: "Maintenance Troubleshooting"
+sidebar_position: 4
+description: >
+  Maintenance Troubleshooting
+---
+
+### How to delete old MySQL binlog files?
+
+1. Connect to your MySQL server using the MySQL client or any other database management tool such as PhpMyAdmin, MySQL Workbench, etc.
+
+2. Run the following command to check the current status of your binary log files:
+
+```sql
+SHOW BINARY LOGS;
+```
+This will display a list of all the binary log files that are currently available on your MySQL server.
+
+3. Determine the last binary log file that you want to keep. This is the file that you want to retain for any future point-in-time recovery or replication purposes.
+
+4. Run the following command to purge all binary logs that are older than the binary log file that you want to retain:
+
+```sql
+PURGE BINARY LOGS TO 'binary_log_file_name';
+```
+
+Replace binary_log_file_name with the name of the last binary log file that you want to keep.
+
+5. After running the command, MySQL will delete all binary log files that are older than the specified file. You can verify that the purge was successful by running the SHOW BINARY LOGS; command again.
+
+Note: Keep in mind that deleting old binary log files can affect point-in-time recovery and replication capabilities, so it's important to only delete files that are no longer needed.

Review Comment:
   Shall we also mention that they can "automate" this process away by setting the `expire_logs_days` in the MySQL configuration file?



##########
docs/Troubleshooting/MySqlSizeIssue.md:
##########
@@ -0,0 +1,36 @@
+---
+title: "Maintenance Troubleshooting"
+sidebar_position: 4
+description: >
+  Maintenance Troubleshooting
+---
+
+### How to delete old MySQL binlog files?
+
+1. Connect to your MySQL server using the MySQL client or any other database management tool such as PhpMyAdmin, MySQL Workbench, etc.
+
+2. Run the following command to check the current status of your binary log files:
+
+```sql
+SHOW BINARY LOGS;
+```
+This will display a list of all the binary log files that are currently available on your MySQL server.
+
+3. Determine the last binary log file that you want to keep. This is the file that you want to retain for any future point-in-time recovery or replication purposes.
+
+4. Run the following command to purge all binary logs that are older than the binary log file that you want to retain:
+
+```sql
+PURGE BINARY LOGS TO 'binary_log_file_name';

Review Comment:
   Maybe it's simpler for users to specify a date instead of an actual binlog file?
   
   `PURGE BINARY LOGS BEFORE '<date>' `



##########
docs/Troubleshooting/MySqlSizeIssue.md:
##########
@@ -0,0 +1,36 @@
+---
+title: "MySQL Troubleshooting"
+sidebar_position: 4
+description: >
+  MySQL Troubleshooting
+---
+
+### How to delete old MySQL binlog files?

Review Comment:
   @warren830 I second @klesh's suggestion on describing the symptom briefly first. Otherwise, it's not clear to users why they'd like to know how to delete old MySQL binlog files.
   
   My recommended title for this section is  "How to manage the quickly increasing MySQL disk consumption?"



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org