I was copying one of my Drupal 6 websites. I exported the database into an sql file. I then began the import into a new empty database. I got an error like this, I didn't write it down perfectly:

INSERT INTO 'cashe_menu' ('cid', 'data', 'espire', 'created', 'header', 'serialized', links:navigation:tree data:a [a bunch of numbers]

MySQL said:
#2006 - MySQL server has gone away

After that error phpMyAdmin stopped working and just came up as a blank white page. But other websites using databases on the server were still running ok. I tried restarting mysql but phpmyadmin still didn't work. I finally had to restart my machine and it started working again.

I exported the database again into an sql file and got the same error and phpmyadmin problems trying to import it.

I just uploaded the database with a different sql file I had made earlier without any trouble.

Could this be a problem or bug in mysql or phpmyadmin? Or is the Drupal database I was using have some kind of problem? It seems to be running the site ok.

-------------------------------

After some investigating I found a row in the cache_menu with ( cid = 'links : primary-links : page-cid : admin/content/node:1 ) is of an ungodly length. It actually crashed my text editor when I tried highlighting it.

How did that happen? I just cleared the catch put I'm feeling anxious about trying another export import...

Any input will be appreciated.

Comments

petermilad’s picture

Same problem happens to me, I think this is a MySQL or PHPMyAdmin error when inserting big Blob values.

Peter Aziz

fagel’s picture

I had the same problem with xampp. This helped for me:
edit .../xampp/sql/bin/my.ini
set max_allowed_packet to e.g. 16M
Cheers

erok415’s picture

sub

Ain't it great....!

vader111’s picture

It worked to me, too. I'm using wamp, increased (responsibly) many values in php.ini, but increasing max_allowed_packet in my.ini solved the problem. Maybe I had already fixed some bottlenecks in php.ini, and the max allowed packed was the last thing to tune.
Happy :)

guidolavespa’s picture

It indeed worked by making;

max_allowed_packet=100M

in my.ini

aiphes’s picture

On usb stick, i get this error on import DB by PMA..i get multiple files of my.ini : xampp-portable\mysql

  • my-huge.ini
  • my-large.ini
  • my-small.ini

how to choose one of them ?
FIXED: renaming one of my- file and set max_allowed_packet on 3M

Dev Server Shared Hosting
8 websites powered by drupal 6,8 & 9 - Hosted by Always Data

dibyadel’s picture

thanks a lot. It worked for me,

sumedha’s picture

Thanks a lot!!!! Worked for me too. Gr8 .... saved lot of my time.

nicholasstuartwilson’s picture

Excellent advice, worked for me.

Sandip Choudhury’s picture

I have to upload 15 MB database to my WAMP phpmyadmin. But it said - #2006 - MySQL server has gone away.

Then I change max_allowed_packet 16 M (default is 1 M) in my.ini file under C: > wamp > bin > mysql. And it works.

Sandip Choudhury
http://hostingultraso.com

vagelis-prokopiou’s picture

Editing the "max_allowed_packet = 32M" in "in C:\MAMP\conf\mysql\my.ini", fixed the 2006 error for me with MAMP on Windows 7. Be carefull because there is also a "[mysqldump] quick max_allowed_packet = 16M".
Don't get confused with this.