I am trying to upload a file using MySQL LOAD DATA LOCAL INFILE function in Python.
In my load.py file, I have done:
import MySQLdb
conn = MySQLdb.connect(host, db_username, db_password, "Core_ver")
c = conn.cursor()
sql = """LOAD DATA LOCAL INFILE 'contact.out' INTO TABLE userinfo FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' (group_ID, rank_ID, login, password, first_name, last_name, email, contact_ID);"""
try:
c.execute(sql)
conn.commit()
except StandardError, e:
print e
conn.rollback()
Its not uploading anything. But I checked, the connection is working fine and the column names are also verified. What might have gone wrong?