Knowledgebase

Incorrect datetime value or Data too long for column Print

  • database, errors, troubleshooting, guide, howto, solution, zillionkinghost, hosting
  • 0

The data does not fit the column.

WHAT IT MEANS

An insert or update supplied a value the column cannot hold.

DATA TOO LONG

The value exceeds the column's defined length. A text field limited to 255 characters receiving more produces this.

Either the data is wrong, or the column needs to be larger.

INCORRECT DATETIME VALUE

Frequently a zero date such as 0000-00-00, which newer MySQL configurations reject under strict mode.

Older applications written against permissive settings produce this on newer servers.

DURING AN IMPORT

A dump from an older MySQL version may contain values the current version rejects.

The usual fixes are adjusting the data in the dump, or importing with the relevant strict mode temporarily relaxed for that session.

DURING NORMAL OPERATION

An application not validating input, or written against older assumptions.

Check whether an update to the application addresses it.

CHARACTER SET ISSUES

Data too long can also occur when a character set mismatch makes text occupy more bytes than expected.

WHAT TO SEND US

The full error, the operation, and whether it occurred during an import.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot