0

我正在尝试运行大量查询并且发生了这种情况。

我正在使用 heidisql 执行

load data infile

命令,但有超过 100 万个条目的文件,它一直失败。我在别处看到这个命令

--net_read_timeout=100

is what i should be using but how do u put that in a query as it doesnt work just typing that into the php my admin kind of window. is it an sql mode command??

for some reason stack overflow wont let me post this question yet as it does not meet their standards so im just going to keep typing until it allows me to submit

4

1 回答 1

0

这可能是因为max_allowed_packet

更改 my.ini/my.cnf 文件。[mysqld]在文件中包含下面的单行

max_allowed_packet=500M

现在restart the MySQL service,一旦你完成了。您可以像这样在 mysql 中看到它的当前值:

SHOW VARIABLES LIKE 'max_allowed_packet'

您可以尝试像这样更改它,但这不太可能适用于共享主机:

SET GLOBAL max_allowed_packet=16777216;

你可以在这里阅读http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html

于 2013-07-24T12:04:06.967 回答