mysql 导入大文件错误总结

注意在导入大文件是一定要用命令行导入:

命令行导入mysql大文件出现以下错误:

1.ERROR 2006 (HY000) at line ***: MySQL server has gone away
2.Got a packet bigger than ‘max_allowed_packet’ bytes or ERROR 1153 (08S01) at line 616: Got a packet bigger than ‘max_allowed_packet’ by tes
3.sqlyog导入数据文件问题,一直提醒:
There was an error while executing a query.
The query and the error message has been logged at:
C:\Users\liang\AppData\Roaming\SQLyog\sqlyog.err.

Please click on "Open Error File..." to open the error file.

 

出现以上问题一般都是my.ini 或者my.cnf参数配置问题

下面说一下具体配置方法:

注意放在[mysqld]下面加上下面配置:
max_allowed_packet=768M 参数大小自己定,我导入的是802M的文件,开始用了64m不行后来改成768M导入成功了

修改完配置:

重启mysql
net stop mysql关闭
net start mysql 启动

进入mysql查看是否成功
show variables like '%max_allowed_packet%';

显示如下:
max_allowed_packet       | 805306368 说明修改成功了

重新导入,哈哈导入成功!



MYSQL BLOB 字段大小

set global 命令动态的修改:
        SET GLOBAL innodb_file_format=barracuda;
        SET GLOBAL innodb_file_per_table=1;



阅读更多
换一批

没有更多推荐了,返回首页