Error Code: 1406. Data too long for column - MySQL

前端 未结 8 1618
抹茶落季
抹茶落季 2020-11-27 05:26

Error Code: 1406. Data too long for column

CREATE  TABLE `TEST` 
(

  `idTEST` INT NOT NULL ,

  `TESTcol` VARCHAR(45) NULL ,

  PRIMARY KEY (`idTEST`) 
);
         


        
8条回答
  •  醉话见心
    2020-11-27 05:45

    This happened to me recently. I was fully migrate to MySQL 5.7, and everything is in default configuration.

    All previously answers are already clear and I just want to add something.

    This 1406 error could happen in your function / procedure too and not only to your table's column length.

    In my case, I've trigger which call procedure with IN parameter varchar(16) but received 32 length value.

    I hope this help someone with similar problem.

提交回复
热议问题