我正在使用 pymysql to_sql 函数从 python 将表写入 mysql。 我有 1000 行和 200 列。
连接mysql的查询如下:
engine = create_engine("mysql://hostname:password#@localhostname/dbname")
conn = engine.connect()
writing query: df.to_sql('data'.lower(),schema=schema,conn,'replace',index=False)
我收到以下错误:
OperationalError: (pymysql.err.OperationalError) (1118,'Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format,BLOB prefix of 0 bytes is stored inline.')
我已将列 dtypes 更改为字符串,但仍然出现上述错误。请帮我解决这个错误。
我正在尝试像下面那样保存表格。在这里,我提供了几列
创建表查询。我在保存时创建表时出错。
CREATE TABLE dbname.table name(
08:00:00
文字,
08:08:00
文字,
08:16:00
文字,
08:24:00
文字,
08:32:00
文字,
08:40:00
文字,
08:48:00
文字,
08:56:00
文字,
09:04:00
文字,
09:12:00
文字,
09:20:00
文字,
09:28:00
文本)