Search code examples
linuxjdbcmariadbmax-allowed-packet

Packet for query to large. Setting max_allowed_packet


When i connect to my databse via phpmyadmin everything works fine and it shows me the data. When i am on my server i can see all data and work with it.

But when i try to connect to my server i'm getting this error:

com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (4.739.923 > 65.535). You can change this value on the server by setting the 'max_allowed_packet' variable.

im getting the max allowed packet size here:


Database changed
MariaDB [selforder]> SELECT @@max_allowed_packet;
+----------------------+
| @@max_allowed_packet |
+----------------------+
|            536870912 |
+----------------------+
1 row in set (0.00 sec)

and i changed my file nano /root/.my.cnf to this:

[mysqld]
max_allowed_packet=536870912

but i still get this error;


Solution

  • not really an answer but my problem was, that i installed multiple versions of mysql, i completly reinstalled my system