Blog

Out of range value adjusted for column

This error or the equally frustrating ‘ Incorrect integer value: ‘ error seems to bite quite a few people in the butt that are running MySQL 5. If you’re getting one of these errors then MySQL is running in strict mode and you are trying to run a query that isn’t inserting a proper value into one of your fields. For example, you have an int field and the value you are inserting into that field is blank.

The proper thing to do would be to go through all of your queries and make sure you are always inserting the proper values, ie. some type of integer for an int field.

There isn’t always time for the proper way however. If you need a quick fix you can run the following MySQL command from your favorite MySQL command prompt, the shell, phpmyadmin, etc.

[bash]
SET GLOBAL SQL_MODE=”
[/bash]

Tags:

Leave a Reply