MySQL 1121: Out of range column value.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
What is

MySQL 1121: Out of range column value.

 ?
  1. Identify the query causing the error. Check application logs or enable the MySQL general log temporarily to capture the problematic SQL statement:


SET global general_log = 1;
SET global log_output = 'table';

After capturing the query, disable logging:
SET global general_log = 0;

  1. Examine the table schema for column definitions related to the error. Use the `DESCRIBE` command:


DESCRIBE yourtablename;

  1. Identify the column mentioned in the error and check its data type limits (e.g., INT, VARCHAR). Compare these limits with the data you are trying to insert or update.



  1. If the issue is due to an integer type limit (e.g., trying to insert a value larger than the maximum allowed for an INT), consider changing the column data type to a larger type (e.g., BIGINT) if data correctness allows:


ALTER TABLE yourtablename MODIFY yourcolumnname BIGINT;

  1. For VARCHAR or similar types, ensure the data you're inserting does not exceed the column's defined length. If necessary and appropriate, adjust the column length:


ALTER TABLE yourtablename MODIFY yourcolumnname VARCHAR(new_length);

  1. Re-run the problematic query to confirm the issue is resolved.



  1. Optionally, if the error persists or you suspect data corruption, check the table for issues:


CHECK TABLE yourtablename;

  1. If step 7 indicates table issues, attempt a table repair (back up the table first):


REPAIR TABLE yourtablename;

Attached error: 
MySQL 1121: Out of range column value.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Master 

MySQL

 debugging in Minutes

— Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

MySQL

Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Your email is safe with us. No spam, ever.

Thank you for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

MORE ISSUES

Deep Sea Tech Inc. — Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid