轉Error Code: 2006 - MySQL server has gone away(Error Code: 2006 - MySQL 服務器已離線)

剛纔在導入數據庫的時候 SQLyog 報錯了

Error Code: 2006 - MySQL server has gone away

搜了下,說是max_allowed_packet (MySQL的一個參數)設置的值不夠大。

那我改下就行了 嘿嘿

In Windows:

In the MySQL server installation directory,
in my.ini file, add the following line under [mysqld] in SERVER SECTION.

max_allowed_packet = 16M


In Linux:

Copy the my-xxx.cnf file from /usr/share/mysql to /etc as my.cnf

xxx can be small, medium, large, huge ... depending on the requirement.

$ cp /usr/share/mysql/my-xxx.cnf /etc/my.cnf

In the my.cnf file, change the default
max_allowed_packet = 1M
to
max_allowed_packet = 16M

Save the file and restart MySQL server.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章