0
Mysql said #2006 - MySQL server has gone away 

In php.ini I have this:

post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M 

I also put this line in config.inc.php

$cfg ['ExecTimeLimit'] = 0;

The database size that I want to upload is 237MB

How could this happen?

Thanks.

Nano
  • 186
  • 2
  • 15
  • 1
    what is your `max_allowed_packet`? http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_allowed_packet – bansi Jan 22 '14 at 07:10
  • @bansi max_allowed_packet = 10M . Any idea? – Nano Jan 22 '14 at 07:14
  • and you are trying to upload a 237MB query? – bansi Jan 22 '14 at 07:16
  • @bansi sure. You mean 10M doesn't enough to upload 237MB ? NO. – Nano Jan 22 '14 at 07:18
  • 1
    if you are trying to upload the entire database as a single query (phpMyAdmin does this when you upload file as query) your query size must be less than `max_allowed_packet`. – bansi Jan 22 '14 at 07:36

2 Answers2

1

This may be due to improper setting of variable 'max_allowed_packet'

Increase this variable in My.cnf or my.ini file of MySQL server . set max_allowed_packet = 1 M

Hope it works!!

Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81
1

The reason for this is most likely the mysql's setting wait_timeout and/or max_allowed_packet. You can see the values for these settings using SHOW VARIABLES.

If you are able, use the utility mysqldump to export/import your tables. In short, using command line:

mysqldump -u -pPASS -h HOST_SOURCE database > dump.sql 
mysql -u -pPASS -h HOST_DESTINATION -D otherdatabase < dump.sql
aconrad
  • 556
  • 5
  • 12