Data truncated for column 'sex' at row 1 错误

Posted ynzj123

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Data truncated for column 'sex' at row 1 错误相关的知识,希望对你有一定的参考价值。

正确示例

非空约束2(CHAR(2)数据过小会出错)
ALTER TABLE books MODIFY title VARCHAR(50) NOT NULL;

---取消非空
ALTER TABLE books MODIFY title VARCHAR(50) NULL;

错误示例

ALTER TABLE books MODIFY sex CHAR(2) NOT NULL;

错误信息

Data truncated for column ‘sex‘ at row 1

原因

CHAR(2)数据过小会出错

转自csdn

技术图片

以上是关于Data truncated for column 'sex' at row 1 错误的主要内容,如果未能解决你的问题,请参考以下文章

Data truncation: Data too long for column ‘context‘ at row 1

Data truncation: Data too long for column ‘context‘ at row 1

Data truncation: Data too long for column ‘context‘ at row 1

javaweb报错:Data truncation: Data too long for column ‘xxx‘ at row 1

javaweb报错:Data truncation: Data too long for column ‘xxx‘ at row 1

Data truncated for column 'sex' at row 1 错误