com.mysql.jdbc.PacketTooBigException

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

    I had the same misleading error message.

    I fixed it by changing my port number to 3306. Previously I had the port number set as 2083 because that's what I use on my web server.

    0 讨论(0)
  • 2020-11-30 13:51

    Edit your my.cnf(ubunut) or my.ini(windows) file and set max_allowed_packet size.

    max_allowed_packet=512M

    Then restart your mysql server.It will work

    0 讨论(0)
  • 2020-11-30 14:02

    If you are unable to stop your database, you can alternatively set the value of the max allowed packet parameter dynamically. To do so:

    1. Log in as a root user.
    2. You'll need to set the value as an integer, rather than '256M'. 256M is equivalent to 256*1024*1024, or 268435456.
    3. mysql> SET GLOBAL max_allowed_packet=268435456;
    4. To check that this has been applied:
    
        a. Relogin to your mysql client.
    
        b. mysql> SELECT @@max_allowed_packet;
    
    Restart your Confluence instance.
    

    You will still need to update your /etc/my.cnf file as described in the method above to make the change persistent.

    0 讨论(0)
提交回复
热议问题