com.mysql.jdbc.PacketTooBigException

前端 未结 9 1214
别那么骄傲
别那么骄傲 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:37

    Packet for query is too large (2285643 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.

    SOLUTIONS:-
    You can see it's current value in mysql like this:
    
    SHOW VARIABLES LIKE 'max_allowed_packet'
    
    You can try to change it like this, but it's unlikely this will work on shared hosting:
    
    SET GLOBAL max_allowed_packet=16777216;
    and restart mysql service..
    

提交回复
热议问题