SET GLOBAL max_allowed_packet doesn't work

前端 未结 5 1434
忘掉有多难
忘掉有多难 2020-12-24 06:51

I found out how to change the default value of max_allowed_packet in MySQL using SET GLOBAL. However, each time I used this command, the default va

5条回答
  •  悲哀的现实
    2020-12-24 07:34

    For those with a MariaDb configuration the problem could be that the max_allowed_packet variable is overwritten by a configuration file called later.

    In my case I tried to import a database and the server answered me: ERROR 2006 (HY000) at line 736: MySQL server has gone away

    I discovered that the file:

    /etc/mysql/mariadb.conf.d/50-server.cnf
    

    is called later

    /etc/mysql/conf.d/mysql.cnf
    

    I tried continuously changing in the "mysql.cnf" file but the value was overwritten in "50-server.cnf".

    So the solution is to enter the file

    /etc/mysql/mariadb.conf.d/50-server.cnf
    

    and instead of "max_allowed_packet = 16M" put the desired value as an example "max_allowed_packet = 64M"

提交回复
热议问题