数据库插入警告
改了好多,一直都不行,老师这个坑有点多啊
改了好多,一直都不行,老师这个坑有点多啊
2020-05-02
3-1 运行代码连接数据库创建数据表时报警告:Warning: (1366, "Incorrect string value: '\\xD6\\xD0\\xB9\\xFA\\xB1\\xEA...' for column 'VARIABLE_VALUE' at row 1")
解决:改用mysql-connector-python驱动。1、安装mysql-connector-python驱动:pip install mysql-connector-python 2、修改代码engine = create_engine("mysql+pymysql://root:123456@127.0.0.1:3306/lagou?charset=utf8mb4") 改为:engine = create_engine("mysql+mysqlconnector://root:123456@127.0.0.1:3306/lagou?charset=utf8mb4")
举报