how to import csv file in to mysql table using cursor code example
Example: python mysql insert csv
# Insert DataFrame to Table
for row in df.itertuples():
cursor.execute('''
INSERT INTO TestDB.dbo.people_info (Name, Country, Age)
VALUES (?,?,?)
''',
row.Name,
row.Country,
row.Age
)
conn.commit()