首页 > 解决方案 > 我在将数据插入 mysql 数据库时遇到错误,这是技术领域的新手,正在为我寻找某人

问题描述

with open('housePrice.csv','r') as f:
    data=csv.reader(f,delimiter='\n')
    for lines in enumerate(data):
        for list_ in (lines[1]):
            cursor.execute('insert into testineuron.houseprice values({values})'.format(values=list_))
        mydb.commit()

houseprice.csv 中的数据 ->

63,1,True,True,True,Shahran,1850000000.0,61666.67

错误->

ProgrammingError: 1054 (42S22): Unknown column 'Shahran' in 'field list'

标签: pythonmysql

解决方案


推荐阅读