当前位置:Gxlcms > 数据库问题 > 修改mysql max_allowed_packet 配置

修改mysql max_allowed_packet 配置

时间:2021-07-01 10:21:17 帮助过:4人阅读

1:当前默认配置

mysql> show VARIABLES like ‘%max_allowed_packet%‘;
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| max_allowed_packet | 4194304 |
| slave_max_allowed_packet | 1073741824 |
+--------------------------+------------+
2 rows in set (0.00 sec)

 

2:修改配置文件

vi /etc/my.cnf

 

[mysqld] 下面增加下面配置:

max_allowed_packet=10M

 

3:重启mysql

service mysqld restart

再次查看修改后的配置

mysql> show VARIABLES like ‘%max_allowed_packet%‘;
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| max_allowed_packet | 10485760 |
| slave_max_allowed_packet | 1073741824 |
+--------------------------+------------+
2 rows in set (0.00 sec)

 

修改mysql max_allowed_packet 配置

标签:star   val   mysql   variables   mys   配置文件   ice   ble   packet   

人气教程排行