Tag Archives: Data truncated for column ‘xxx’

Solution of data truncated for column ‘xxx’ in MySQL

Explain the function of static keyword and final keyword in Java in detail>>>

DATA truncated FOR COLUMN ‘description’ AT ROW 1

1. Error reappearance

Null field in table

At this point, modify a field in the table as the primary key

2. Solutions

Null fields are not allowed in the database

Null fields are not allowed in the database

Null fields are not allowed in the database

3. Cause of the problem

This error is actually caused by the illegal inserted data

For example: garbled code, over field length, illegal characters, etc., the data inserted here is caused by over field length

At that time, the field description (description) of the table in MySQL database was varchar (32), and the number of inserted data was more than 32, so it can be modified to varchar (300)