python MySQL Code Error 1064,Warning 1265错误

MySQL 1064错误排除
插入字段有特殊字符,如:单双引号问题。
方法:
import pymysql
text = pymysql.escape_string(your_text))

Note: To see complete list of warning(s), enable Tools -> Preferences -> General -> Show Warning(s) in Messages Tab

Execution Time : 0.031 sec
Transfer Time : 0 sec
Total Time : 0.031 sec

Warning Code : 1265
Data truncated for column 'location' at row 1

原来是location字段设置的长度太短了,插入的数据被自动截断了


python MySQL Code Error 1064,Warning 1265错误_第1张图片

你可能感兴趣的:(python MySQL Code Error 1064,Warning 1265错误)