今天導入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
總算是解決了問題,雖然還沒鬧明白為什麼會有這種現象出現,大家有知道的還請告之一下,不勝感激