天天看點

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

錯誤重制:

插入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.