Error 3135 is raised when NO_ZERO_DATE, NO_ZERO_IN_DATE, or ERROR_FOR_DIVISION_BY_ZERO sql modes are enabled without strict mode, which is disallowed in MySQL 5.7.8 and later.
MySQL error 3135 (ER_SQL_MODE_MERGED) occurs when NO_ZERO_DATE, NO_ZERO_IN_DATE, or ERROR_FOR_DIVISION_BY_ZERO are set without STRICT_TRANS_TABLES or STRICT_ALL_TABLES. Add a strict mode or remove the standalone flags to resolve the issue.
ER_SQL_MODE_MERGED
MySQL raises error 3135 when you enable NO_ZERO_DATE, NO_ZERO_IN_DATE, or ERROR_FOR_DIVISION_BY_ZERO in sql_mode without also enabling STRICT_TRANS_TABLES or STRICT_ALL_TABLES.
The server blocks this mix because those checks will be folded into strict mode in future versions, and running them separately would cause upgrade inconsistencies.
The error is triggered at server startup, during SET sql_mode statements, or when a session inherits an invalid mode list.
Resolving it immediately ensures reliable data validation and smoother version upgrades.
The primary cause is a sql_mode string that lists one of the legacy flags but omits any strict mode option.
Such strings often originate from old configuration files, application‐level overrides, or connection strings in database libraries.
Starting with MySQL 5.7.8, the server validates sql_mode on every assignment and throws ER_SQL_MODE_MERGED if the combination is unsafe.
Include STRICT_TRANS_TABLES or STRICT_ALL_TABLES alongside the legacy flags, or remove the legacy flags entirely because strict mode already enforces their behavior.
Apply the change globally in my.cnf or instantly at session level using SET sql_mode.
Server fails to start due to NO_ZERO_DATE in my.cnf. Add STRICT_TRANS_TABLES and restart to clear the error.
An ORM issues SET SESSION sql_mode='NO_ZERO_IN_DATE'. Replace the statement with SET SESSION sql_mode='STRICT_TRANS_TABLES' in the ORM configuration.
A CI pipeline imports dumps that set forbidden modes. Update the dump scripts to use a strict mode list before deployment.
Always pair strict mode with any legacy validation flags when editing sql_mode.
Centralize sql_mode management in version‐controlled configuration files to prevent environment drift.
Verify sql_mode with SELECT @@GLOBAL.sql_mode in staging during upgrades and resolve warnings before production rollout.
ER_TRUNCATED_WRONG_VALUE (1292) appears when strict mode blocks invalid date inserts. Correct the input data.
ER_UNKNOWN_SYSTEM_VARIABLE (1193) is triggered by misspelled sql_mode flags. Check spelling against supported modes for your MySQL version.
Configurations migrated from MySQL 5.6 often list NO_ZERO_DATE or NO_ZERO_IN_DATE without strict mode, leading to error 3135 after upgrade.
Frameworks or ORMs may explicitly set sql_mode to NO_ZERO_DATE expecting old behavior, which modern servers reject.
Database connectors that allow sql_mode parameters can trigger ER_SQL_MODE_MERGED when strict mode is omitted.
Appears when strict mode rejects invalid dates or numbers. Validate and correct incoming data.
Occurs under strict mode when a required column is omitted. Provide a value or set a default.
Raised when a nonexistent sql_mode flag is supplied. Verify the flag name and MySQL version.
No. The server simply rejects the invalid sql_mode assignment. Data and schema remain untouched.
You can, but you lose valuable data validation. It is safer to keep strict mode and drop the redundant flags.
STRICT_TRANS_TABLES is recommended for most workloads as it validates per row, while STRICT_ALL_TABLES rolls back entire statements on error.
No. The validation was introduced in 5.7.8. Upgrading exposes the misconfiguration so you can address it sooner.