Mysql index without key specification on replace?

独自空忆成欢 提交于 2021-01-07 02:35:53

问题


I have the following code:

mytable.to_sql(name='mytable', con=engine, index=True, if_exists='replace')

But it keeps throwing the following error:

'(1170, "BLOB/TEXT column 'index' used in key specification without a key length")'[SQL: CREATE INDEX ix_mytable_index ON mytable (index)]

I think I understand why the error happens but in the context for the code above I don't know how to specify the length. I can't change the underlying database since this code was handed down to me.

来源:https://stackoverflow.com/questions/64993374/mysql-index-without-key-specification-on-replace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!