MySQL导入大SQL文件报错

分类:技术文档 - JS文档 | 阅读(1086) | 发布于:2014-06-24 14:55

采用 MySQL下命令: source /root/hr_resume_work_0_2014_05_29.sql;
或采用Linux命令:  mysql -uroot -p123456 hr_resume_center_for_history <  /root/hr_resume_work_0_2014_05_29.sql
均报错显示:
    ERROR 2006 (HY000): MySQL server has gone away
    No connection. Trying to reconnect...
    Connection id:    10
    Current database: hr_resume_center_for_history

    ERROR 2006 (HY000): MySQL server has gone away
    No connection. Trying to reconnect...
    Connection id:    11
    Current database: hr_resume_center_for_history

    ERROR 2006 (HY000): MySQL server has gone away
经查是修改MySQL配置文件后倒入成功:
    vi /etc/my.cnf
    修改[mysqld]下面的 max_allowed_packet = 1024M
    根据实际自己调整。
    然后 service mysql restart
    再次执行倒入即可

标签:MySQL