0

This may look like a duplicate to this question, but i followed the solution from the answer yet it still doesn't work. I'm using XAMPP by the way. This is how I do it.

 mysql -u root -p
 mysql> SET GLOBAL max_allowed_packet=33554432;
 Query OK, 0 rows affected (0.00 secs)
 mysql> SHOW VARIABLES LIKE 'max_allowed_packet';

After that I restart mysql then go back and the result is still max_allowed_packet = 1048576 .

Then I added, not edited, this lines of code into php.ini at the very bottom of the code because those lines does not exist in the php.ini file.

[mysqld]
max_allowed_packet = 32M
[mysqldump]
max_allowed_packet = 32M

Restart again. Check the max_allowed_packet and it still the same 1048576 bytes. Are they any more solutions to fix it so I can upload files larger than 1MB? Or did i do something wrong here?

Community
  • 1
  • 1
Hazirah_Halim
  • 87
  • 2
  • 16

1 Answers1

0

max_allowed_packet is a MySQL Server system variable.

The setting of the system variable can be specified in the my.cnf file, under the [mysqld] section.

It can also be supplied as an option in the mysqld_safe start command; but don't do that. Just add it to the my.cnf file.

(MySQL Server hasn't a foggy notion of what a php.ini file is.)

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_allowed_packet

spencer7593
  • 106,611
  • 15
  • 112
  • 140