com.mysql.jdbc.PacketTooBigException

前端 未结 9 1213
别那么骄傲
别那么骄傲 2020-11-30 13:08

I have a big problem! when I do this:

 String query = \"SELECT * FROM utente WHERE confermato=1 and Username=\'\" + username
            + \"\' AND Password         


        
9条回答
  •  误落风尘
    2020-11-30 13:45

    I meet this problem and solve it by change my mysql-connector version .May be my mysql-connector version in pom is too high.

    Stack Print:

    Thu Nov 03 18:24:03 CST 2016 WARN: Invalid value 'null' for server variable named 'auto_increment_increment', falling back to sane default of '1'.
    Exception in thread "main" com.mysql.jdbc.PacketTooBigException: Packet for query is too large (44 > -1). You can change this value on the server by setting the max_allowed_packet' variable.
        at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:577)
        at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:417)
        at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3105)
        at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2336)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2729)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1962)
        at com.sparkproject.jdbc.JDBCHelper.main(JDBCHelper.java:382)
    

提交回复
热议问题