title: MySQL has gone away with pymysql
body: <p>I am running a query using pymysql in python 3, something like:</p>
  
  <pre><code>conn = 'con info here'
  
  cur = conn.cursor()
  
  cu.execute('sql goes here')
  </code></pre>
  
  <p>The query goes among the lines of:</p>
  
  <pre><code>load data
  local infile 'file path'
  ignore into table table_name
  fields terminated by '/t'
  optionally enclosed by '"'
  lines terminated by '\r\n'
  ignore 1 lines
  
  (@col1,
  @col2,
  @col3)
  set
  (col1indb = @col1,
  col2indb = @col2,
  col3indb = @col3)
  </code></pre>
  
  <p>When I execute the query, I immediately get this:</p>
  
  <pre><code>File "/opt/python3/lib/python3.4/site-packages/pymysql/cursors.py", line 296, in _query
      conn.query(q)
    File "/opt/python3/lib/python3.4/site-packages/pymysql/connections.py", line 781, in query
      self._affected_rows = self._read_query_result(unbuffered=unbuffered)
    File "/opt/python3/lib/python3.4/site-packages/pymysql/connections.py", line 942, in _read_query_result
      result.read()
    File "/opt/python3/lib/python3.4/site-packages/pymysql/connections.py", line 1143, in read
      self._read_load_local_packet(first_packet)
    File "/opt/python3/lib/python3.4/site-packages/pymysql/connections.py", line 1178, in _read_load_local_packet
      sender.send_data()
    File "/opt/python3/lib/python3.4/site-packages/pymysql/connections.py", line 1317, in send_data
      self.connection._write_bytes(packet)
    File "/opt/python3/lib/python3.4/site-packages/pymysql/connections.py", line 929, in _write_bytes
      raise err.OperationalError(2006, "MySQL server has gone away (%r)" % (e,))
  pymysql.err.OperationalError: (2006, "MySQL server has gone away (BrokenPipeError(32, 'Broken pipe'))")
  </code></pre>
  
  <p>Since the error occurs immediately, I am sure it is not a timeout. Every single other query that I run works fine, even similar load queries.</p>
  
  <p>My question is, what in the MySQL syntax can cause this error??</p>
  
  <p>Thanks! </p>