title: importing single .csv into mysql with python
body: <p>when running this code i am getting a <code>Error while connecting to MySQL Not all parameters were used in the SQL statement</code></p>
  <p>I have tried also to ingest these with another technique</p>
  <pre><code>import mysql.connector as msql
  from mysql.connector import Error
  import pandas as pd
  
  empdata = pd.read_csv('path_to_file', index_col=False, delimiter = ',')
  empdata.head()
  
  try:
      conn = msql.connect(host='localhost', user='test345',  
                          password='test123')
      if conn.is_connected():
          cursor = conn.cursor()
          cursor.execute(&quot;CREATE DATABASE timetheft&quot;)
          print(&quot;Database is created&quot;)
  except Error as e:
      print(&quot;Error while connecting to MySQL&quot;, e)
  
  try:
      conn = msql.connect(host='localhost', database='timetheft', user='test345', password='test123')
      if conn.is_connected():
          cursor = conn.cursor()
          cursor.execute(&quot;select database();&quot;)
          record = cursor.fetchone()
          print(&quot;You're connected to database: &quot;, record)
          cursor.execute('DROP TABLE IF EXISTS company;')
          print('Creating table....')
          create_contracts_table = &quot;&quot;&quot;
           CREATE TABLE company ( ID VARCHAR(40) PRIMARY KEY, 
          Company_Name VARCHAR(40), 
          Country VARCHAR(40), 
          City VARCHAR(40), 
          Email VARCHAR(40),  
          Industry VARCHAR(30),
          Employees VARCHAR(30)
          );
          &quot;&quot;&quot;
          cursor.execute(create_company_table)
          print(&quot;Table is created....&quot;)
          for i,row in empdata.iterrows():
              sql = &quot;INSERT INTO timetheft.company VALUES (%S, %S, %S, %S, %S,%S,%S,%S)&quot;
              cursor.execute(sql, tuple(row))
              print(&quot;Record inserted&quot;)
              # the connection is not auto committed by default, so we must commit to save our changes
              conn.commit()
  except Error as e:
              print(&quot;Error while connecting to MySQL&quot;, e)
  </code></pre>
  <p>second technique I tried</p>
  <pre><code>LOAD DATA LOCAL INFILE 'path_to_file'  
  INTO TABLE copmany  
  FIELDS TERMINATED BY ';' 
  ENCLOSED BY '&quot;'   
  LINES TERMINATED BY '\n'  
  IGNORE 1 LINES;
  </code></pre>
  <p>worked better but many errors. only 20% of rows ingested.</p>
  <p>Finally here is an excerpt from the .csv  (data is consistent throughout all 1K rows)</p>
  <p>&quot;ID&quot;;&quot;Company_Name&quot;;&quot;Country&quot;;&quot;City&quot;;&quot;Email&quot;;&quot;Industry&quot;;&quot;Employees&quot;
  217520699;&quot;Enim Corp.&quot;;&quot;Germany&quot;;&quot;Bamberg&quot;;&quot;posuere@diamvel.edu&quot;;&quot;Internet&quot;;&quot;51-100&quot;
  352428999;&quot;Lacus Vestibulum Consulting&quot;;&quot;Germany&quot;;&quot;Villingen-Schwenningen&quot;;&quot;egestas@lacusEtiambibendum.org&quot;;&quot;Food Production&quot;;&quot;100-500&quot;
  371718299;&quot;Dictum Ultricies Ltd&quot;;&quot;Germany&quot;;&quot;Anklam&quot;;&quot;convallis.erat@sempercursus.co.uk&quot;;&quot;Primary/Secondary Education&quot;;&quot;100-500&quot;
  676789799;&quot;A Consulting&quot;;&quot;Germany&quot;;&quot;Andernach&quot;;&quot;massa@etrisusQuisque.ca&quot;;&quot;Government Relations&quot;;&quot;100-500&quot;
  718526699;&quot;Odio LLP&quot;;&quot;Germany&quot;;&quot;Eisenhüttenstadt&quot;;&quot;Quisque.varius@euismod.org&quot;;&quot;E-Learning&quot;;&quot;11-50&quot;</p>