Hi all,
I’m new with DO and I got a LAMP 16.04 setup.
I’m creating a JavaFX desktop and trying to connect it to the MySQL server.
my.cnf has been edited - added max_allowed_packet = 1048576
.
I also tested it by show variables like 'max_allowed_packet'
in MySQL.
BUT, an error is still showing when I build the app.
com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4739923 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
SOLUTION: First, I’m a newbie so take my approach with that perspective. Second, after spending HOURS searching and searching… One comment, yes one, suggested that the error is misleading. His issue was that the url was spelled wrong. So that got me thinking.
This article gave me the final key
So what I did was to check my access, ports and privileges and that’s how I found my issue.
bind-address = 0.0.0.0
in my.cnf file~$ sudo ufw status
and add port 3306$ sudo ufw allow 3306
database
.* TO ‘mysqluser’@‘%’`` - this can be done in my phpmyadmin too.I don’t do a ton of stuff with Java but the error is showing that the packet size is still larger than the setting you set. I would look for a way to either reduce this on the client side or further increase it in my.cnf and restart MySQL.
Doing a bit of searching found this StackOverflow thread where one person also indicated that in some cases this error is misleading and they found a different solution.