Home > Database > Mysql Tutorial > body text

mysql导入sql文件报错 ERROR 2013 2006 2002

WBOY
Release: 2016-06-07 16:27:51
Original
3333 people have browsed it

今天导入sql总是提示错误 ERROR 2013 (HY000): Lost connection to MySQL server during query ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... ERROR 2002 (HY000): Can't connect to local MySQL server through s

今天导入sql总是提示错误


ERROR 2013 (HY000): Lost connection to MySQL server during query
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
ERROR:
Can't connect to the server

网上试了很久,各种修改my.cnf,最后发现有人说是insert语句一次插入太多行造成的,解决办法就是每次insert一行

用mysqldump导出 加上参数--skip-extended-insert

不清楚是不是跟mysql版本有关,我的版本是
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

总算是解决了问题,虽然还没闹明白为什么会有这种现象出现,大家有知道的还请告之一下,不胜感激

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!