How to Fix MySQL Error 3135 (ER_SQL_MODE_MERGED)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get mysql error 3135 when you set date or division modes without strict mode. You fix it by turning on strict SQL mode alongside those specific rules. The database engine logs this message with the symbol ER_SQL_MODE_MERGED and SQLSTATE HY000. It warns you that separate date and division checks will merge into strict mode. When you see this alert, your server settings or client session rules need an update. Why mysql error 3135 happens in your database MySQL uses SQL modes to control how

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 3135 when you set date or division modes without strict mode. You fix it by turning on strict SQL mode alongside those specific rules.

The database engine logs this message with the symbol ER_SQL_MODE_MERGED and SQLSTATE HY000. It warns you that separate date and division checks will merge into strict mode. When you see this alert, your server settings or client session rules need an update.

Why mysql error 3135 happens in your database

MySQL uses SQL modes to control how the server checks data during write queries. Three specific rules check for bad dates and math errors. These rules are NO_ZERO_DATE, NO_ZERO_IN_DATE, and ERROR_FOR_DIVISION_BY_ZERO.

In older setups, teams could turn on these three rules by themselves. Later, the database engine decided to merge these three checks into strict mode. If you set any of these three rules without strict mode, the server complains.

This triggers mysql error 3135 during your session or server startup. The database tells you to pair those three modes with strict mode. You can also see this warning when an app sends custom session settings after logging in.

Many frameworks send their own mode string when they start a database session. If that string misses strict mode, the server returns this HY000 state warning. Replication followers can also log this alert if the primary server sends outdated mode rules.

How to find the source of the mode warning

Start by checking where the mode change comes from. Check your server startup file first. Look at the global mode setting on your database host.

If the global setting includes strict mode, check your app code next. Search your codebase for connection hooks that change session variables after login. Database drivers often run a setup command right after they open a link.

You should also check your database user profiles and stored routines. Stored procedures and triggers save the SQL mode active when someone created them. If an old routine runs without strict mode, it can trigger the warning.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Ask your team to check query logs for session setup commands. Finding the exact client that sends the outdated rule saves hours of guesswork. You do not need to grant admin rights to developers during this check.

How to fix the SQL mode safely in production

You can fix this issue in two safe ways. First, you can add strict transactional mode to your active mode list. This keeps your date and division rules active and satisfies the server check.

Second, you can remove the three separate date and division modes from your custom list. Once you enable strict mode, the engine enforces those rules on its own. Make sure you test this change in a staging setup before production.

Strict mode rejects bad dates and division by zero instead of just logging warnings. If your legacy app writes zero dates, strict mode will block those inserts. Fix your app code so it writes valid dates or null values first.

Update your central database group rules rather than running manual fixes by hand. When you change server settings, keep your team permissions tight. Do not turn off all SQL modes just to hide the warning message.

Turning off strict checks puts your data quality at risk. Bad rows can slip into tables and break downstream reports. Keep strict mode active and clean up the old mode strings across your apps.

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

What does symbol ER_SQL_MODE_MERGED mean in MySQL?

ER_SQL_MODE_MERGED is the system name for error code 3135 and SQLSTATE HY000. It warns that zero date and division modes will merge into strict SQL mode.

Can I fix error 3135 by clearing all SQL modes?

Clearing all modes stops the warning, but it removes vital data safety checks. You should enable strict mode instead so the database blocks bad dates and math errors.

Why does my app trigger error 3135 when the server config is clean?

Many app drivers send their own session mode command right after they log in. Check your app connection settings and update the mode string to include strict mode.

The query runs. The emails stay hidden.