Avatar of Victor Kimura
Victor Kimura
Flag for Canada asked on

java.sql.SQLException: Packet for query is too large (4739923 > 1048576)

Hi,

I'm wondering why I'm still getting this error in my PHPStorm Database connection properties after I updated my.cnf and set the max_allowed_packet variable to 75M. I restarted MySQL and I executed the command:
mysql> select @@max_allowed_packet;

and I get the correct 73M.

So, what's the problem still?
MySQL ServerJavaJava EE

Avatar of undefined
Last Comment
Victor Kimura

8/22/2022 - Mon
Valeri

looks like the files you are trying to upload are still more than 75M. change it for example to 200M and try again.
Another reason coud be that mySQL needs restart after this change.
Victor Kimura

ASKER
This is the error I get. I have more than the 4M stated in the error. Also, mentioned in the original post that I restarted MySQL.

Connection to Data Source failed
java.sql.SQLException: Packet for query is too large (4739923 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.

Any other possibilities?
dpearson

I'm not much of a DB specialist but the docs say that there are 2 variables that control this - one in the client and the other in the server:
http://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html

So the PHP client may also need to define this max packet size when opening the connection. (I have no idea how you set that in PHP - but in Java I'd look at the URL used to open the database connection).

Also it says:
You can also get strange problems with large packets if you are using large BLOB values but have not given mysqld access to enough memory to handle the query. If you suspect this is the case, try adding ulimit -d 256000 to the beginning of the mysqld_safe script and restarting mysqld.

Doug
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Victor Kimura

ASKER
Hi fellows,

I think it's a Jetbrains PHPStorm issue. I'm going to try and update to the latest build. I contacted tech for Jetbrains and that's what they said. I'll find out soon enough. Thank you for the feedback. I'll post here and respond if the update to the latest build works or not. =)
ASKER CERTIFIED SOLUTION
Victor Kimura

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Victor Kimura

ASKER
Upgrading to the latest IDE resolved the problem. God bless<><