MySQL:Data truncated for column ‘root_rank’ at row 22

created at 06-02-2022 views: 9

Error while writing data to mysql

Error 1: Data truncated for column 'root_rank' at row 22

possible reasons

  1. The length of the data is greater than the maximum length defined for the field. For example, if the field user_name VARCHAR(10) is defined, this field defines the maximum length of 10 characters. However, if the data you write exceeds 10 characters, then this warning message will appear.
  2. Incorrect data type. For example, the field cost DECIMAL(10,2) is defined, this field allows two decimals. However, if the data you write exceeds two decimal places, such as 10.1122, this warning message will appear.
  3. trying to insert unsupported characters.

solution

For specific problems, you can adjust the field type of the database table, or check whether the inserted data does not meet expectations.

created at:06-02-2022
edited at: 06-02-2022: