```python
df.to_sql('name', con, if_exists='replace', index=True, index_label= 'id', dtype={'id':VACHAR(20)}
会报错误
InternalError: (pymysql.err.InternalError) (1170, "BLOB/TEXT column 'code' used in key specification without a key length")
解决办法,改成以下形式
```python
df.to_sql('name', con, if_exists='replace', index=True, index_label= 'id', dtype={None:VACHAR(20)}