How to Fix MySQL Error 3795 (ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE)
You get mysql error 3795 when you change the slow log file format without logging to a file. To fix it, enable file output for your slow query log in the server settings. This message has the symbol ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE and uses SQLSTATE HY000. The server accepts your format change, but it warns you that the change does nothing right now. Your database still runs, yet your log tools might miss key slow query details. What causes mysql error 3795 in your database
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get mysql error 3795 when you change the slow log file format without logging to a file. To fix it, enable file output for your slow query log in the server settings.
This message has the symbol ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE and uses SQLSTATE HY000. The server accepts your format change, but it warns you that the change does nothing right now. Your database still runs, yet your log tools might miss key slow query details.
What causes mysql error 3795 in your database
MySQL lets you send slow query logs to a file, a system table, or nowhere. When you change the slow log format mode, that setting only applies to text files on disk. If your server sends logs only to a table, the file format rule has no effect.
This issue also happens when the slow query log is turned off or disabled at startup. Admins often see this warning when running setup scripts across many database servers at once. One server might log to a table while another writes to a local disk file.
The database engine throws code 3795 to stop you from making a false assumption. You might think extra query metrics are going into your log table, but tables have fixed columns. Only the file target can change its layout to hold those extra statistics.
How to check and fix slow log settings
First, check where your database sends log events right now. Look at the active log output target and check if the slow log is turned on. If the output target only lists table storage, you found the root cause of the warning.
Next, update the log output rule so it includes file storage. You can send logs to both a file and a table at the same time if needed. After you enable file output, turn on the slow query log if it is still off.
MySQL Access Governance + K8s Audit Logging: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Once file logging is active, your format mode change will work right away. Check the disk file to confirm that the new slow query fields appear in each entry. Make sure you also save these settings in your startup file so they survive a restart.
How to manage database changes safely in production
Changing log settings in production requires strong access controls and clear audit trails. You should not give every developer full admin rights just to check or tune log settings. Broad privileges increase the risk of accidental changes to core server variables.
Instead, limit admin actions to approved requests and review every command before it runs. When teams inspect slow queries or table logs, watch out for sensitive data in query text. Data masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs in results.
This approach keeps private user details safe while engineers fix slow queries and server warnings. Your team can tune database performance and fix log rules without exposing raw customer secrets.
Inspect every MySQL query and response in flight
Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.
First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.
Frequently asked questions
Does mysql error 3795 stop my change from saving?
No, the server still saves your requested change to the slow log file format mode. It just warns you that the setting does nothing until you start logging to a file.
Can I use the extended slow log format with table output?
No, the extended format setting only changes what the server writes to disk files. The system slow log table uses a fixed structure that does not change when you update format modes.
How do I clear warning 3795 during automated setup?
Set your log output target to include file storage before you change the slow log format mode. Changing the settings in that order prevents the server from raising the warning.
Related guides
In this post