How to Fix MySQL Error 3615 (ER_VAR_DOES_NOT_EXIST)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get mysql error 3615 when you try to clear a variable missing from the persisted file. You can fix it by checking the persisted variables table before running a reset command. MySQL lets you save global system settings to a local file on the disk. These saved settings stay in place even when the database server restarts. When an admin tries to remove a setting that is not in that file, the server stops. It returns the symbol ER_VAR_DOES_NOT_EXIST and the SQLSTATE code HY000. The server mess

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 3615 when you try to clear a variable missing from the persisted file. You can fix it by checking the persisted variables table before running a reset command.

MySQL lets you save global system settings to a local file on the disk. These saved settings stay in place even when the database server restarts. When an admin tries to remove a setting that is not in that file, the server stops. It returns the symbol ER_VAR_DOES_NOT_EXIST and the SQLSTATE code HY000. The server message states that the variable does not exist in the persisted config file. This guide explains why this happens and how your team can fix it.

Why mysql error 3615 happens in your database

MySQL stores runtime settings in two main places on the host machine. Standard static files hold the base settings that load when the server starts. A separate persisted file holds dynamic changes made by admins while the server runs. When you tell the database to clear a persisted variable, it checks only that dynamic file.

If the setting lives only in memory or in the static file, the reset fails. This often happens when teams mix manual file edits with live SQL admin commands. One engineer might set a value in memory without saving it to the disk. Another engineer later tries to clear the saved value from the disk file. Because the file never held that key, the database throws mysql error 3615.

Automation scripts also trigger this issue during rollbacks or server cleanups. A script might try to reset a long list of settings to clean up a node. If one setting on that list was never saved to the persisted file, the script fails. You will also see this error if someone makes a typo in the variable name.

How to check and fix persisted variable errors

To fix this error, first check which variables actually live in the persisted file. MySQL provides a performance schema table that lists all saved disk variables and their values. Query this table to see if the target variable is present on that node. If the variable is not in the list, you do not need to clear it.

When your goal is to change a live value in memory, update the global variable instead. Updating the global memory value works right away and does not check the persisted file. If the variable sits in a static file on the host, edit that file directly. You will need to restart the service or reload the settings after editing static files.

MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

When writing cleanup scripts, always include conditional checks before clearing persisted settings. Your script can add a clause that ignores missing variables during the reset step. This stops the database from throwing an error when a setting is already gone. Your deployment jobs can then run across many database nodes without failing halfway through.

Safe ways to manage database settings in production

Changing global variables in production carries high risk for your apps and data. Giving every engineer full admin rights to change server settings leads to drift and outages. Instead, restrict who can run system admin commands on live database nodes. Use strict role permissions so only approved workflows can alter persisted settings.

You should also log every admin query that changes how the server runs. When an error occurs, audit logs show who changed the variable and when it happened. Masking rules can also rewrite sensitive fields like emails or card numbers in query results. This keeps private data safe while engineers check server tables and fix variable issues.

Check MySQL queries and results on the wire

MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL, inline in the MySQL wire protocol. On every query an AI agent or human runs against production MySQL, RDS, or Aurora, hoop.dev decides to pass, mask, block, or hold it for review.

Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails, which refuse banned queries with a native MySQL error or hold risky ones for approval. On the response path, hoop.dev data masking rewrites string values in returned rows in memory, and every decision is logged. See the MIT-licensed project on GitHub.

Frequently asked questions

Does mysql error 3615 affect running queries or app traffic?

No, this error only stops the specific admin command that tried to clear the variable. Your existing server settings stay the same, and normal app queries keep running fine.

What does the ER_VAR_DOES_NOT_EXIST symbol mean in MySQL?

ER_VAR_DOES_NOT_EXIST is the official MySQL error symbol linked to code 3615 and SQLSTATE HY000. It means the variable you asked to remove is not in the persisted config file.

How can I avoid this error in automated database scripts?

Use the conditional check option in your reset statement so MySQL skips missing variables. Instead of failing with an error, the server will just log a harmless warning.

The query runs. The emails stay hidden.