Webyog Forums: Error Code: 2006 - Mysql Server Has Gone Away - Webyog Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Error Code: 2006 - Mysql Server Has Gone Away Error Code: 2006 - MySQL server has gone away

#1 User is offline   jack111 Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 21
  • Joined: 06-September 06

Posted 11 May 2007 - 12:06 PM

Have mysql 5 , apache2 and php5 set up as localhost on a windows xp pro machine.

have backed up databases as sql dump from remote servers using sqlyog. I want to get the sites runing on localhost thus trying to restore the sql dumps on the localhost mysql database. sql connects ok but after about 10 seconds get the error

Error Code: 2006 - MySQL server has gone away


Why is this.

the servers I have backed up from are also runing mysql five.
0

#2 User is online   peterlaursen Icon

  • Advanced Member
  • PipPipPip
  • Group: Admin
  • Posts: 6,557
  • Joined: 01-June 03
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 11 May 2007 - 02:20 PM

"Error Code: 2006 - MySQL server has gone away"

I think the most likely reason is that the (server) max_allowed_packet setting is too low compared to the size of BULK inserts in the file.

Old server versions dispaly only that in this situation.  5.0.41 say "got a package too big" or something like that!
Computers make your grey hair come off ....

Peter Laursen
Webyog
0

#3 User is offline   jack111 Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 21
  • Joined: 06-September 06

Posted 11 May 2007 - 06:55 PM

View Postpeterlaursen, on May 11 2007, 03:20 PM, said:

"Error Code: 2006 - MySQL server has gone away"

I think the most likely reason is that the (server) max_allowed_packet setting is too low compared to the size of BULK inserts in the file.

Old server versions dispaly only that in this situation. 5.0.41 say "got a package too big" or something like that!


Thanks that was exactly the problem. Followed the instructions below

http://dev.mysql.com...-too-large.html

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.

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

Save the file and restart MySQL server.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users