插入MySQL报错‘pymysql.err.DataError: (1406, "Data too long for column 'url' at row 1")’

时间:2021-01-12 11:05:26   收藏:0   阅读:0

错误重现:

插入MySQL报错‘pymysql.err.DataError: (1406, "Data too long for column ‘url‘ at row 1")’

解决方法:

在插入MySQL的字符太多,此时将MySQL的模式改为非严格模式。
MySQL中运行:
mysql> SET @@global.sql_mode= ‘‘;

【搬运国外大神解释】

MySQL will truncate any insert value that exceeds the specified column width.

to make this without error try Switch your MySQL mode to not use STRICT.

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!