Contents
  1. 1. Background
  2. 2. Error Info
  3. 3. Solutions
  4. 4. Reasons

Background

When I do an insert operation to save the item data to MySQL, occurs an error.

Error Info

1
Error updating database.  Cause: java.sql.SQLException: Data truncated for column 'xxx' at row 1

Solutions

Check whether the column type is right.

Check whether the length of the field value over the length of the column.

Reasons

The length of the field value over the length of the column.

My passed field value is a set type value, but the column type is enum. The column type should update to set.

Contents
  1. 1. Background
  2. 2. Error Info
  3. 3. Solutions
  4. 4. Reasons