The MySQL 8.4.13 release notes list October 20, 2026 as its release date; they do not announce a new slow-log rotation behavior. Use the MySQL 8.4 documentation to identify the log destination and growth source, rotate the file using the supported procedure, and verify MySQL has reopened it. Do not confuse the slow query log with binary logs or error logs, and do not substitute direct deletion for rotation. MySQL 8.4.13 release notes
Last updated November 19, 2026; checked against the MySQL 8.4.13 release notes and MySQL 8.4 log documentation.
This guide is for DBAs responsible for MySQL 8.4 production systems who are facing a growing slow log or a disk alert.
It is also for database-host operators who need a safe rotation, permissions, and retention process.
SaaS technical leads can use it to decide whether measured log growth changes their storage plan.
When the alert fires: identify the file before touching it
Start with the exact path named by the disk alert. Do not decide what a file is from its name alone. MySQL maintains multiple server logs, and an alert for a full filesystem does not tell you which file caused it. The MySQL server logs overview distinguishes the slow query log from other server logs, including the binary log and error log.
Check the alert path against the database’s configured log destination and slow-log file path. In a MySQL client, inspect the relevant global settings:
SELECT
@@GLOBAL.slow_query_log,
@@GLOBAL.slow_query_log_file,
@@GLOBAL.log_output,
@@GLOBAL.long_query_time,
@@GLOBAL.log_queries_not_using_indexes;
These values answer several different questions:
- Is slow query logging enabled?
- Which path does MySQL use for the slow query log?
- Does the server send log output to a file, a table, or both?
- What threshold and additional recording option may be affecting the amount of data?
The MySQL 8.4 log-destination documentation explains the available destinations. If the alert points to a binary log, stop here and follow your binary-log retention and replication procedures instead. Removing a binary log that a replica still needs can disrupt replication or recovery. If it points to the error log, use the error-log maintenance procedure. Neither is interchangeable with slow-log rotation.
Also record the filesystem, file owner, current size, and whether the database process still has the path open. On Unix-like systems, tools such as stat and lsof can help you inspect those details; use the equivalent tools and service-account checks for your operating system. This initial record gives you a baseline for verifying the result later.
Before rotation: establish what is driving growth
The slow query log is a record of queries selected by its configuration; it is not a diagnosis of why the database is slow. MySQL’s slow query log documentation describes the threshold behavior and the option for recording queries that do not use indexes.
Review both settings before changing anything. A lower long_query_time can capture more statements. Enabling log_queries_not_using_indexes can add entries that do not meet your usual time-based expectation. That option may be useful during a targeted investigation, but a larger log does not prove that every recorded query needs an index or that the database has one single performance problem.
Compare the increase with operational events:
- Did an application release, scheduled job, import, or reporting workload change around the time the file started growing?
- Did a configuration change alter
long_query_timeor enablelog_queries_not_using_indexes? - Are entries repeated versions of the same query pattern, or many distinct statements?
- Does the growth continue during quiet periods, or does it track a known workload window?
Use a representative sample rather than making decisions from one conspicuous entry. The official mysqldumpslow documentation describes a tool for summarizing and sorting slow-log entries. For example, you can sort by query time and limit the displayed results:
mysqldumpslow -s t -t 20 /path/to/slow.log
Replace the path with the verified log path. The limit in this example controls how many results the tool displays; it is not a recommended retention or alert threshold. Treat summaries as a way to group patterns for investigation. They are not a substitute for checking query plans, application behavior, or the database’s actual workload.
Choose the rotation procedure for the configured destination
Use the procedure that matches what you found. Rotation of a file-based log and maintenance of a table-based log are different tasks.
| Option | What to verify first | Suitable action | Main risk to control |
|---|---|---|---|
| File destination on a Unix-like host | Active path, MySQL service account, directory permissions | Rename the active file, then issue FLUSH SLOW LOGS |
MySQL may fail to create or write the replacement file if ownership or permissions are wrong |
| File destination on another operating system | Configured path and that platform’s file-handling behavior | Follow the platform-specific MySQL and operating-system procedure | A Unix rename sequence may not apply as written |
| Table destination | log_output and the relevant MySQL log table |
Follow the documented table-maintenance approach | Filesystem rotation will not rotate a table-based log |
| Both file and table destinations | Both output paths and the retention requirements for each | Maintain each destination independently | Clearing one destination does not control growth in the other |
For file maintenance, the MySQL 8.4 log-file maintenance guide documents the rename-and-refresh approach. On a Unix-like host, the sequence is generally:
sudo mv /path/to/slow.log /path/to/slow.log.ARCHIVE
mysql -e "FLUSH SLOW LOGS;"
Use a deliberate archive name that fits your team’s retention process. Confirm the path and permissions before running commands; these examples do not replace your distribution’s service-account and directory-ownership checks. The MySQL account issuing the refresh needs the applicable administrative privilege. Consult the MySQL FLUSH statement documentation for the privilege requirements and statement behavior.
Do not use rm on a log file that MySQL may still have open as a generic fix. The process can continue writing to an unlinked file, leaving disk space occupied even though the path no longer appears in a directory listing. Renaming the file and asking MySQL to reopen the log makes the handoff explicit and verifiable.
If you use a table destination, do not run the filesystem sequence and assume the log has rotated. Check the documented table-maintenance procedure and your retention needs first. Keep any required records before cleaning them up.
After rotation: verify the new file and access
A successful command is not the same as a successful rotation. Confirm that the new path exists, that the MySQL service account can write to it, and that the server is directing new entries to the expected destination. Check the server error log if the new file does not appear or remains empty.
Then confirm activity rather than relying on the filename. Make a read-only inspection of the file metadata and, after normal application traffic has had a chance to run, verify whether its size or modification time changes. Do not generate artificial load on a production database just to force a log entry. If the workload has no qualifying query during your observation period, an unchanged file alone does not prove that rotation failed.
If MySQL does not reopen the file, retrace the handoff:
- Was the path you renamed the value currently reported by
slow_query_log_file? - Is
log_outputconfigured to includeFILE? - Did the refresh statement complete without an error?
- Can the MySQL service account traverse the directory and create or write the replacement file?
- Does the server error log show a path, permission, or file-opening problem?
Do not repeatedly rename files or broaden permissions without identifying the failure. Correct the path or ownership issue, apply the documented refresh, and repeat the verification. Keep the archived file until you have confirmed the new destination is working and your retention rules permit removing the archive.
Keep the record useful without retaining it forever
Set a rotation and retention policy based on the purpose of the log. A short investigation may call for a different retention window from an ongoing audit or operational review. Define who reviews the entries, who approves configuration changes, where archives are stored, and who is responsible for removing them under the team’s policy.
Track the values that make future incidents easier to explain: the log destination, active path, configured threshold, whether log_queries_not_using_indexes is enabled, rotation time, archive location, and observed file growth over a stated interval. Compare like with like. A file size without its measurement period or workload context cannot tell you whether growth has accelerated.
Treat slow-log contents as potentially sensitive. Query text can reveal application behavior and, depending on what applications send, may expose information that should not be broadly accessible. Restrict access to the active log and archives, and follow your organization’s rules for storage and deletion. MySQL’s password logging guidance describes how password handling relates to logs; it is not a reason to assume every other piece of query content is safe to share. Review who can read archived logs, including anyone with access to backups or support bundles. AMDSSH’s data privacy guidance is also relevant when you are deciding how to handle data stored on a hosted server.
If the log begins growing quickly again, return to the settings and query patterns. Increasing disk capacity can give you room to investigate, but it does not identify or fix a query, workload, or recording-scope change. Likewise, shorter retention can control stored volume while discarding evidence you may still need. Make those decisions based on measured growth and investigation requirements, not as a substitute for finding the cause.
FAQs
What should you check when the MySQL slow query log keeps growing?
Start with the alerted file path, then verify the configured destination and the settings that affect recording. Compare the timing of growth with application or workload changes, and summarize representative entries before changing thresholds. Once you know the file is a file-based slow log, rotate it using the documented procedure and verify that MySQL writes to the replacement.
What is the safe way to rotate a MySQL 8.4 slow query log?
For a file-based log on a Unix-like host, rename the active file and issue FLUSH SLOW LOGS using an appropriately authorized account. Check that MySQL can create and write the replacement file, then confirm it has reopened the intended path. Adapt the procedure to your operating system; the example command sequence is not a universal method for every platform or destination.
Why can log_queries_not_using_indexes make the log grow?
It adds a recording condition for queries that do not use indexes, so the log may include statements beyond those captured by the time threshold alone. Inspect representative entries and the setting’s current value before deciding whether it belongs in your configuration. If you change it, document the reason and verify the effective setting; the volume of entries by itself does not identify the performance root cause.
What should you check if rotation does not create a new slow log file?
Confirm that the server writes to a file, that the configured path is the one you renamed, and that FLUSH SLOW LOGS completed successfully. Then check directory ownership, file permissions, and the MySQL error log for an opening failure. If the server writes to a table, use the appropriate table-maintenance process rather than expecting filesystem rotation to create a file.
Turn measured growth into a storage decision
After you have a reliable growth measurement, use it to review the amount of space your database host needs for active logs, retained archives, database files, and recovery operations. Compare measurements from representative workload periods and include the retention your team actually requires. Do not turn a brief observation into a fixed capacity promise, and do not count a local copy as an off-host backup.
Slow-log rotation does not protect database files from disk failure. Plan redundancy through software RAID or replication as appropriate to your recovery design, and keep backups outside the production machine. Local mirroring and replication are not substitutes for an independently stored backup.
If you are running on a shared cloud instance, variable neighbor load, limits on disk choices, and storage billing that is hard to map to long-term growth can complicate predictable database operations. An AMDSSH dedicated AMD server is worth comparing when you need exclusive compute resources and control over a sustained database deployment, but it will not correct slow queries or remove your backup and maintenance responsibilities. Check the current AMDSSH server options against your measured log growth, database footprint, and recovery plan before changing hosts.
Frequently asked questions
What should I do when the MySQL slow query log keeps growing?
First confirm the alert’s exact path and whether it is the slow query log, a binary log, or another file. Check the log destination and settings that affect what gets recorded, then compare file growth with deployment and workload changes. Rotate the file using the method for its output type, verify MySQL is writing to the new file, and investigate the queries behind the increase.
How do I rotate the MySQL 8.4 slow query log safely?
For a file-based slow log on Unix-like systems, rename the active file rather than deleting it, then issue `FLUSH SLOW LOGS` with an account authorized to run that statement. Confirm that MySQL created or reopened the expected path and that its service account can write there. The exact commands and ownership checks depend on your operating system and deployment.
Why does the log grow after I enable log_queries_not_using_indexes?
That setting records queries that do not use indexes, so it can add entries beyond queries that exceed your slow-query time threshold. Review representative entries and compare the log’s growth before changing the setting. If the extra records are not useful for your investigation, adjust the setting deliberately, then verify the effective value for new connections and keep a record of the change.
Why did MySQL not create a new slow log file after rotation?
Check that the server is configured to write to a file, that the configured path matches the file you renamed, and that you refreshed the slow log after the rename. Then inspect the directory and file permissions for the MySQL service account, along with the server error log. If the destination is TABLE rather than FILE, filesystem rotation is not the right procedure.
Further reading
EPYC 7543P dedicated serverFrom $450.2/month