Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set max_allowed_packet in phpmyadmin?

I have to change max_allowed_packet size in MySQL using phpmyadmin, but I don't know how to do it. When I try set global max_allowed_packet=10M in phpmyadmin it give this error

#1227 - Access denied; you need the SUPER privilege for this operation

I can't get SUPER privilege, because server is not in my control.

So, How can I change it?

like image 731
user1390378 Avatar asked Jul 08 '13 21:07

user1390378


3 Answers

You will have to set this in MySQL as well .. Generally found here:

/etc/mysql/my.cnf

Example:

max_allowed_packet      = 16M

If the server is not in your control, you are going to have to ask for access to said file.

like image 126
Zak Avatar answered Sep 21 '22 15:09

Zak


You cannot.

To change it dynamically, as with the SET you tried, you need the SUPER privilege, there is no way around it. And this is a good thing, because 1. the setting is global, which means it affects all connections, and 2. it might jeopardize the server (it makes it easier to DoS a server, for example).

To set it permanently, you need access to the MySQL configuration file and be able to restart the service, as Zak advises.

The real question is, however, why do you need such a high limit. Unless you are trying to import a large dump, having a need for such a limit almost always suggests something was wrongly designed in the first place. If you are importing a dump, try to import smaller bits at a time.

like image 45
RandomSeed Avatar answered Sep 20 '22 15:09

RandomSeed


You can change variables from the "Server variables and settings" page, which is accessible via "Variables" at the top or at [server]/phpmyadmin/server_variables.php

Look up "max_allowed_packet", and hit Edit - default is 4194304 (4MB, in bytes).

like image 30
user4560259 Avatar answered Sep 20 '22 15:09

user4560259