How to change max_allowed_packet size

后端 未结 12 1820
星月不相逢
星月不相逢 2020-11-22 09:16

I am having a problem with BLOB fields in my MySQL database - when uploading files larger than approx 1MB I get an error Packets larger than max_allowed_packet are not

12条回答
  •  我在风中等你
    2020-11-22 09:26

    One of my junior developers was having a problem modifying this for me so I thought I would expand this in greater detail for linux users:

    1) open terminal

    2) ssh root@YOURIP

    3) enter root password

    4) nano /etc/mysql/my.cnf (if command is not recognized do this first or try vi then repeat: yum install nano )

    5) add the line: max_allowed_packet=256M (obviously adjust size for whatever you need) under the [MYSQLD] section. He made a mistake of putting it at the bottom of the file first so it did not work.

    enter image description here

    6) Control + O (save) then ENTER (confirm) then Control + X (exit file)

    7) service mysqld restart

    8) You can check the change in the variables section on phpmyadmin

提交回复
热议问题