mysql max_allowed_pa​​cket = 500M

时间:2019-05-31 12:10:20

标签: mysql

我正在尝试导入数据库信息,但出现此错误:

The current max allowed package is 16777216 bytes but the statement length is 32409630 bytes.
Please INCREASE the limit and RECONNECT the workspace (⌘ ⇧ R). You can run the following statement to increase the limit:
SET GLOBAL max_allowed_packet=1073741824; 

所以我用Google搜索了,并将此文件/etc/mysql/my.cnf更改为此:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise, they'll be ignored.
#

[mysqld]
max_allowed_packet=500M

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

请注意,我已添加[mysqld] max_allowed_packet=500M

我已经重新启动服务器。但是我仍然会收到此错误。

这是个错误的地方吗?或者这里可能是错的?

https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html

-编辑-

运行:

SET GLOBAL max_allowed_packet=1073741824;

效果不佳。

0 个答案:

没有答案