【问题标题】:ERROR 2006 (HY000) at line 2759: MySQL server has gone awayERROR 2006 (HY000) at line 2759: MySQL server has gone away
【发布时间】:2017-12-21 06:27:24
【问题描述】:

我正在尝试使用 cmd 中的此命令将 sql 文件导入我的数据库:

mysql -u  root -p social-media-db < socialmediaexaminer_dev_2017-07-15T18-41-51_UTC_database.sql

是的,我之前用谷歌搜索过,阅读了所有现有文档,为什么会发生这种情况,但没有任何帮助。它说

ERROR 2006 (HY000) at line 2759: MySQL server has gone away

我的文件:

我的默认.ini

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]
max_allowed_packet=99999999M
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

我要导入的文件是 1.4GB。

【问题讨论】:

标签: mysql database memory import


【解决方案1】:

您的设备不太可能在您的 .ini 中支持此请求 --

max_allowed_packet=99999999M

这将是大约 99,999,999,000,000 字节的内存。 99 TB?

将其减少到 100M 左右,如果这对您有用,请告诉我们。

【讨论】:

    猜你喜欢
    • 2012-10-30
    • 2020-05-28
    • 2013-12-16
    • 2011-12-11
    • 1970-01-01
    • 2011-02-04
    • 2012-12-19
    • 2019-10-13
    • 2015-12-02
    相关资源
    最近更新 更多