title: MySQL server configuration issues
body: <p>As my topic says, the max_allowed_packet variable is not working.
  I have a project in eclipse which loads csv-files up and store them into a mysql database through a servlet. For files smaller than 1M it works fine.
  But my file is 95Mb big, and i have increase the 'max_allow_packet' variable in the my.ini file in the section [mysqld] up to 500M.
  But it doesen't work. Eclipse gives my the same error.
  Please take a look at this two pictures:</p>
  
  <p>ECLIPSE</p>
  
  <p><img src="https://i.stack.imgur.com/jg88t.jpg" alt="enter image description here"></p>
  
  <p>my.ini</p>
  
  <p>[mysqld]
  ....</p>
  
  <p><img src="https://i.stack.imgur.com/XRIkT.jpg" alt="enter image description here"></p>
  
  <p>Thanks for help</p>
  
  <p>*****EDIT*****</p>
  
  <pre><code>com.mysql.jdbc.PacketTooBigException: Packet for query is too large (190104490 &gt; 26214400). You can change this value on the server by setting the max_allowed_packet' variable.
  at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3540)
  at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2417)
  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535)
  at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911)
  at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145)
  at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2081)
  at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2066)
  at upload.Upload.doPost(Upload.java:71)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>And this is the main-code where the file is upload and then store in mysql:</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
      response.setContentType("text/html;charset=UTF-8");
  
      Part part = request.getPart("file");
  
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      InputStream in = part.getInputStream();
      CSV csv = new CSV();
  
  
      String name = null;
      String header = part.getHeader("content-disposition");
      if(header.contains("filename"))
      {
          name = header.substring(header.lastIndexOf("=") + 1, header.length()).replace("\"", "");
      }
  
  
      int i = 0;
      while((i = in.read()) != -1 )
      {
          baos.write(i);
      }
      csv.setCsvFile(baos.toByteArray());
      csv.setName(name);
      baos.flush();
  
      try {
          try {
              Class.forName("com.mysql.jdbc.Driver").newInstance();
          } catch (InstantiationException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IllegalAccessException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      } catch (ClassNotFoundException e1) {
          e1.printStackTrace();
      }
      try {           
          Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/loadcsvup","*****","*******");        
          PreparedStatement stmt = con.prepareStatement("INSERT INTO loadcsvup.csvfiles (csv_name,file) VALUES (?,?)");
          stmt.setString(1, csv.getName());
          stmt.setBytes(2, csv.getCsvFile());         
          stmt.executeUpdate();
  
          stmt.close();
          con.close();
  
      } catch (SQLException e) {
          e.printStackTrace();
      }
  
  
  }
  </code></pre>
  
  <p>***** EDIT 2 *****</p>
  
  <p>Ok, now i have set the varibale also in de [client] section of the my.ini file. Seems to be work.
  But now i got this error code:</p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: The size of   BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
  at com.mysql.jdbc.Util.handleNewInstance(Util.java:389)
  at com.mysql.jdbc.Util.getInstance(Util.java:372)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771)
  at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535)
  at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911)
  at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2145)
  at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2081)
  at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2066)
  at upload.Upload.doPost(Upload.java:71)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>I've set the varibable like this:</p>
  
  <pre><code>[mysqld]
  innodb_file_per_table=1
  innodb_buffer_pool_size=1GB
  innodb_log_file_size=128M
  innodb_log_buffer_size=8M
  </code></pre>