Common SQL Errors

MySQL Error 3027 ER_SQL_MODE_NO_EFFECT - Causes, Fixes, and Prevention

Galaxy Team
August 8, 2025

The sql_mode value supplied is obsolete and ignored in MySQL 5.7.4+, triggering ER_SQL_MODE_NO_EFFECT (Error 3027).

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 3027 ER_SQL_MODE_NO_EFFECT?

MySQL Error 3027 ER_SQL_MODE_NO_EFFECT appears when you set a deprecated sql_mode value. MySQL ignores that mode and asks you to switch to STRICT_ALL_TABLES or STRICT_TRANS_TABLES. Update your sql_mode and restart the session or server to fix the issue.

Error Highlights

Typical Error Message

ER_SQL_MODE_NO_EFFECT

Error Type

Configuration Error

Language

MySQL

Symbol

or STRICT_TRANS_TABLES instead. ER_SQL_MODE_NO_EFFECT was added in 5.7.4.

Error Code

3027

SQL State

HY000

Explanation

Table of Contents

What is MySQL Error 3027 ER_SQL_MODE_NO_EFFECT?

MySQL raises Error 3027 when you attempt to enable a sql_mode value that was removed in version 5.7.4 and later. The server prints the message '%s' mode no longer has any effect. Use STRICT_ALL_TABLES or STRICT_TRANS_TABLES instead.

The error is purely informational but signals that your current sql_mode configuration is outdated. Ignoring it can hide data-quality problems that strict SQL modes normally catch.

What Causes This Error?

Error 3027 is triggered during connection or SET SESSION sql_mode when the mode list includes deprecated options like ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, or PAD_CHAR_TO_FULL_LENGTH.

From MySQL 5.7.4 forward, these options were removed or folded into STRICT modes. Any script, my.cnf file, or client session that still references them will hit ER_SQL_MODE_NO_EFFECT.

How to Fix ER_SQL_MODE_NO_EFFECT

Remove obsolete flags and replace them with supported strict modes. The safest replacement is STRICT_ALL_TABLES because it enforces strict checks for both transactional and non-transactional tables.

Apply the change either at the global server level in my.cnf or dynamically in your session, then reconnect to verify the warning disappears.

Common Scenarios and Solutions

Legacy applications upgraded from MySQL 5.6 often carry forward old sql_mode settings in configuration management templates. Update those templates to prevent repeated warnings.

CI pipelines that run SET GLOBAL sql_mode in migration scripts should add conditional checks for server version before executing outdated flags.

Best Practices to Avoid This Error

Standardize on STRICT_ALL_TABLES or STRICT_TRANS_TABLES across all environments. Version-control your my.cnf and review it during upgrades.

Leverage a modern SQL IDE like Galaxy to lint connection scripts. Galaxy surfaces deprecated sql_mode values inline, preventing commits that would trigger Error 3027.

Related Errors and Solutions

Error 1067 invalid default value can appear after you switch to strict mode because invalid dates become disallowed. Fix the column defaults accordingly.

Error 1364 Field doesn't have a default value may arise once strict mode is active. Provide explicit column values or adjust schema defaults.

Common Causes

Deprecated sql_mode Options

ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, PAD_CHAR_TO_FULL_LENGTH and similar flags were removed in 5.7.4. Their presence triggers Error 3027.

Outdated my.cnf Templates

Configuration files copied from older servers often include deprecated modes. Restarting MySQL with such a file causes the server to log ER_SQL_MODE_NO_EFFECT.

Migration Scripts

Deployment scripts that run SET SESSION sql_mode='...' without version checks may include obsolete modes, generating the warning at runtime.

Related Errors

Error 1067 - Invalid Default Value

Occurs when strict mode is enabled and a column default violates date or numeric constraints.

Error 1364 - Field doesn't have a default value

Raised in strict mode when an INSERT omits a NOT NULL column without default.

Error 1292 - Truncated Incorrect Double Value

Appears under strict mode for invalid numeric conversions.

FAQs

Does Error 3027 affect query results?

No. The server ignores the deprecated mode and continues processing. The warning highlights an outdated configuration that should be corrected.

Which strict mode should I choose?

STRICT_ALL_TABLES is safest because it enforces data integrity checks on all storage engines. STRICT_TRANS_TABLES limits enforcement to transactional tables.

Will switching to strict mode break my application?

Strict mode may surface hidden data issues. Test in staging first, fix invalid data or schema defaults, then deploy to production.

How does Galaxy help?

Galaxy flags deprecated sql_mode values during code review and provides AI suggestions to update them, preventing Error 3027 before deployment.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo