Sunday, April 29, 2012

MYSQL error 2006

When importing a mysql database using phpadmin, the import would fail halfway though with error

Mysql error 2006 - the mysql server has gone away

This is a problem with MYSQL configuration.

To fix this problem locate your my.ini or my.cnf file. In my configuration it was stored under the program directory ie

e:/programs/mysql sever 5.5

Simply edit my.ini and under section

# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]

Add the following lines


key_buffer = 16M
# it was 1M by default
max_allowed_packet= 64M
wait_timeout= 6000


Stop the mysql service in control panel and restart it.#

The problem should be fixed