Why mysql max_allowed_packet reset to 1 m automatically

I have installed

SET GLOBAL max_allowed_packet=16777216; 

and

[mysqld]
max_allowed_packet = 16M

I checked max_allowed_packet with the command

SHOW VARIABLES LIKE 'max_allowed_packet';

and value = 16777216

But after a few days, max_allowed_packet will automatically reset to 1M.

+4
source share
6 answers

I'm sure you hacked. I had the same problem for several months. I opened general_log and finally found some codes:

   connect root@someipaddress on
   Query select 0x4D5A900..........(verylong)
   Query select sys_exe('cmd /c  c:/windows/nbvqc4.vbs')
   .........
   set global max_allowed_packet 1024
   ........

: change the root password.

+5
source

MySQL has both GLOBAL variables and SESSION variables, as well as my.cnf.

GLOBAL- my.cnf, GLOBAL SESSION. GLOBAL, SESSION , GLOBAL .

, GLOBAL- my.cnf, "SHOW VARIABLES", SESSION. , , . , , , , .

, "max_allowed_packet"; SHOW SESSION VARIABLES LIKE 'max_allowed_packet';

,

(1) ,  (2) SET GLOBAL max_allowed_packet, , script  (3) , my.cnf , - , . SHOW GLOBAL STATUS, , .

- . , --max_allowed_packet, , , .

+1

, - . root .

+1

max_allowed_packet 1M MySQL. , "max_allowed_packet" . , "SHOW VARIABLES LIKE" max_allowed_packet '; .

,

MySQL max_allowed_packet:

: [mysql] , [mysqldump], [] . : [mysqld].

0

"" "N", 1 . max_allowed_packet.

0

We just ran into this problem, and the root cause is that we were hacked. On the third side, a script was launched that changed the value down.

Advice for those who are trying to find out if the hack is the main reason for them - temporarily change your MySQL log to include all queries. This is how we decided to find the problem.

0
source

All Articles