title: how to enable "Load data local infile " in mysql JDBC?
body: <p>i am trying to load data into a table through Java program using JDBC.
  i have already done these steps :</p>
  
  <blockquote>
    <p>sudo nano /etc/mysql/my.cnf</p>
  </blockquote>
  
  <p>Then add:</p>
  
  <blockquote>
    <p>[mysqld] local-infile = ON</p>
    
    <p>[mysql] local-infile = ON</p>
  </blockquote>
  
  <p>on running the this program:</p>
  
  <blockquote>
    <p>Code:</p>
  
  <pre><code>Statement statement = con.createStatement();String sql="Create table tbl_user_analysis (Country varchar(10),State Varchar(20))";
  statement.executeUpdate("drop table tbl_user_analysis");
  statement.executeUpdate(sql);
  statement.executeUpdate("load data local infile /home/Asus/workspace/example/xyz into table tbl_user_analysis fields terminated by '\\t' ");
  </code></pre>
  </blockquote>
  
  <p>But i am getting this exception:</p>
  
  <blockquote>
    <p>Exception in thread "main"
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an
    error in your SQL syntax; check the manual that corresponds to your
    MySQL server version for the right syntax to use near
    '/home/Asus/workspace/example/xyz into table
    tbl_user_analysi' at line 1   at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)     at
    com.mysql.jdbc.Util.getInstance(Util.java:386)    at
    com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)    at
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)    at
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)    at
    com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)     at
    com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)  at
    com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2788)   at
    com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1816)
      at
    com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1730)
      at example1.example.main(example.java:281)</p>
  </blockquote>