MySQL max_allowed_packet设置问题

樱花泪 发布于 2016/03/18 16:32
阅读 276
收藏 0

show VARIABLES like '%max_allowed_packet%';

显示的结果为:
+--------------------+---------+ | Variable_name      | Value   | +--------------------+---------+ | max_allowed_packet | 1048576 | +--------------------+---------+
 
以上说明目前的配置是:1M
当偶在my.cof文件里面设置

max_allowed_packet      = 20M

重启后就可以了,但是过一段时间,他自己有变成了初始值,每次出现这样的问题都需要重启,

实在麻烦,有没有办法设置好后,就不要在设置的,

请大神指教

加载中
0
山南子
山南子
You have two values of max_allowed_packet in MySQL :

    one on the client side : [mysql] section, [mysqldump], [client] and more.
    one on the server side : [mysqld] section.

The value of max_allowed_packet you see with the command show variables like 'max_allowed_packet'; is the one on the server side.

In order to increase this value, you must increase both sides : in your server configuration file ([mysqld] section in your my.ini file) and in your client configuration file (whether your [client] or [mysql] section in your my.ini file).
返回顶部
顶部