mysqldude
Error codes › 1264

MySQL & MariaDB error 1264: Out of range value for column

Error messageOut of range value for column '…' at row …
Example from our test runs: Out of range value for column 'age' at row 1 (5.6.51)

A number doesn't fit the column's type (TINYINT holds -128 to 127, INT about +/-2.1 billion, UNSIGNED no negatives). An error in strict mode, a silent clip to the limit otherwise.

MySQLMariaDB
SymbolER_WARN_DATA_OUT_OF_RANGEER_WARN_DATA_OUT_OF_RANGE
SQLSTATE2200322003
TypeServer errorServer error
Versionsevery release since 5.0 activeevery release since 5.5 active

What it means

The value is outside the range of the column’s numeric type. With strict mode (STRICT_TRANS_TABLES, the default since MySQL 5.7 and MariaDB 10.2.4) the statement fails. Without it, the server stores the nearest limit (300 becomes 127 in a TINYINT) and only raises warning 1264.

Why it happens

  • The column is too small: TINYINT for an age is fine, for a quantity it isn’t; INT for IDs, byte counts or phone numbers eventually overflows.
  • A negative value into an UNSIGNED column.
  • DECIMAL(5,2) holds at most 999.99, so 1000 is out of range.
  • An AUTO_INCREMENT column reaching the top of its type. That surfaces as 1062 or 167 instead, see 1062.

How to fix it

  • Widen the column: ALTER TABLE t MODIFY qty INT; (or BIGINT). On a big table this rebuilds it, so plan the change.
  • Validate input in the application if the limit is a business rule.
  • Don’t turn off strict mode to hide this: the value then silently changes to the limit, which is worse than an error.

Reproduce it yourself

These steps are the exact test our harness runs. Use a scratch server, never production.

  1. Connect with mysql -u root -p and create a scratch database and the test data:

    CREATE DATABASE demo;
    USE demo;
    CREATE TABLE t (age TINYINT);
  2. Run:

    SET SESSION sql_mode = 'STRICT_TRANS_TABLES';
    INSERT INTO t VALUES (300);

You get: Out of range value for column 'age' at row 1(11.8.9)

Verified fixes

  1. Widen the column to a type that holds the value

    SET SESSION sql_mode = 'STRICT_TRANS_TABLES';
    ALTER TABLE t MODIFY age SMALLINT;
    INSERT INTO t VALUES (300);
    SELECT age FROM t;

Tested on

StepMySQLMariaDB
5.65.78.08.4910.610.1111.411.8
Insert 300 into a TINYINT (range -128 to 127) in strict mode
repro
✓ 1264✓ 1264✓ 1264✓ 1264✓ 1264✓ 1264✓ 1264✓ 1264✓ 1264
Without strict mode the value is silently clipped to 127 (warning 1264)
version check
⚠ 1264⚠ 3090,1264⚠ 1264⚠ 1264⚠ 1264⚠ 1264⚠ 1264⚠ 1264⚠ 1264
Widen the column to a type that holds the value
fix
✓⚠ 3135,3090⚠ 3135⚠ 3135⚠ 3135✓✓✓✓
Insert 300 into a TINYINT (range -128 to 127) in strict mode repro
MySQL 5.6✓ 12645.7✓ 12648.0✓ 12648.4✓ 12649✓ 1264
MariaDB 10.6✓ 126410.11✓ 126411.4✓ 126411.8✓ 1264
Without strict mode the value is silently clipped to 127 (warning 1264) version check
MySQL 5.6⚠ 12645.7⚠ 3090,12648.0⚠ 12648.4⚠ 12649⚠ 1264
MariaDB 10.6⚠ 126410.11⚠ 126411.4⚠ 126411.8⚠ 1264
Widen the column to a type that holds the value fix
MySQL 5.6✓5.7⚠ 3135,30908.0⚠ 31358.4⚠ 31359⚠ 3135
MariaDB 10.6✓10.11✓11.4✓11.8✓
✓works ✓ 1062fails with the error the step demonstrates ⚠works with a warning ≠runs, result differs ✗fails Tested 2026-11-25 on 5.6.51, 5.7.44, 8.0.46, 8.4.13, 9.7.4, 10.6.28, 10.11.19, 11.4.13, 11.8.9
What the warnings and failures say (4)
  • Without strict mode the value is silently clipped to 127 (warning 1264) (MySQL 5.6, MySQL 8.0, MySQL 8.4, MySQL 9, MariaDB 10.6, MariaDB 10.11, MariaDB 11.4, MariaDB 11.8): warning 1264: Out of range value for column 'age' at row 1
  • Without strict mode the value is silently clipped to 127 (warning 1264) (MySQL 5.7): warning 3090: Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.; warning 1264: Out of range value for column 'age' at row 1
  • Widen the column to a type that holds the value (MySQL 5.7): warning 3135: 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with stric; warning 3090: Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
  • Widen the column to a type that holds the value (MySQL 8.0, MySQL 8.4, MySQL 9): warning 3135: 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with stric

Related errors

  • 1265 WARN_DATA_TRUNCATEDexplained
  • 1366 ER_TRUNCATED_WRONG_VALUE_FOR_FIELDexplained
  • 1690 ER_DATA_OUT_OF_RANGEexplained
How the message changed between versions
MySQL fromSymbolMessage
5.0.96ER_WARN_DATA_OUT_OF_RANGEOut of range value adjusted for column '%s' at row %ld
5.1.77ER_WARN_DATA_OUT_OF_RANGEOut of range value for column '%s' at row %ld