今天導(dǎo)入sql總是提示錯(cuò)誤
代碼如下:
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
網(wǎng)上試了很久,各種修改my.cnf,最后發(fā)現(xiàn)有人說(shuō)是insert語(yǔ)句一次插入太多行造成的,解決辦法就是每次insert一行
用mysqldump導(dǎo)出 加上參數(shù)--skip-extended-insert
不清楚是不是跟mysql版本有關(guān),我的版本是
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
總算是解決了問(wèn)題,雖然還沒(méi)鬧明白為什么會(huì)有這種現(xiàn)象出現(xiàn),大家有知道的還請(qǐng)告之一下,不勝感激
更多信息請(qǐng)查看IT技術(shù)專(zhuān)欄