On LOAD DATA LOCAL INFILE integer required error <p>I have a data file containing data in following format</p> <pre><code>asd,12,asd,asd,12,adsd,,asdas,None </code></pre> <p>I have a table in mysql which is has an <code>auto increment</code> int <code>id</code> and the rest of the columns as in data file.</p> <p>Now i am trying</p> <pre><code>query2 = """LOAD DATA LOCAL INFILE 'tmp.txt' REPLACE INTO TABLE mytable FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n' (a1,a2,a3,a4,a5,a6,a7,a8,a9) """ conn = mysql.connector.connect(user=self.db_config.dbusername, password=self.db_config.dbpassword, host=self.db_config.dbhost, database='something', client_flags=[ClientFlag.LOCAL_FILES]) cursor = conn.cursor() cursor.execute(query2) conn.commit() cursor.close() conn.close() </code></pre> <p>the error i get is </p> <blockquote> <p>class 'mysql.connector.errors.InterfaceError'> Failed executing the operation; an integer is required</p> </blockquote> <p>because of presence of auto increment id i tried appending <code>SET ID=None</code> as suggested by some posts,but the result was same.tmp.txt is in the same location as the script.This response is being sent by mysql server.</p> <p>The <code>MYSQL Server is on amazon</code> is that makes a diff.</p> <p>Any idea what could be causing this or how we can debug it?</p> <p>Digged in deep.</p> <p>The error comes when </p> <pre><code>execute method in /usr/local/lib/python2.7/site-packages/mysql/connector/cursor.py is called with the query as parameter cmd_query in /usr/local/lib/python2.7/site-packages/mysql/connector/protocol.py is called _handle_resultset in /usr/local/lib/python2.7/site-packages/mysql/connector/protocol.py is called read_lc_int in /usr/local/lib/python2.7/site-packages/mysql/connector/utils.py is called which return (buf,None) </code></pre> <p>and so <code>_handle_resultset</code> function fails.So this definitely has something to do with the response coming from server when <code>LOAD DATA</code> query is sent.</p>