ERROR 2006 (HY000) at line 172: MySQL server has gone away

Today I imported the MySQL database and I got the following error:

# mysql -u root -p db_test < test.db
Enter password:
ERROR 2006 (HY000) at line XX: MySQL server has gone away

It is because the data (SQL query) is too large to imported. To solve this problem, simply edit the MySQL configuration files: /etc/my.cnf

Replace the following from:

max_allowed_packet = 1M

To:

max_allowed_packet = 16M

Or something higher.

Restart the MySQL server again and the problem will be gone.

/usr/local/share/mysql/mysql.server restart

–Derrick

Our sponsors:

6 Replies to “ERROR 2006 (HY000) at line 172: MySQL server has gone away”

  1. John E.

    This is a good,common sense article.Very helpful to one who is just finding the resources about this part.It will certainly help educate me.

    Reply
  2. Thero

    Hey friend can i publish some paragraph of your post on my little blog of university.I have to publish a good post out there and i really think your post Fits best into it.I will be grateful to give you an source link as well.I have two blogs one my own and the other which is my college blog.I will publish some part in the university blog.Hope you do not mind.Greetings

    Reply
  3. Sonja Bulle

    Many thanks for sharing this wonderful post. Please hold up this weblog as ensure that it is an example of my preferred web site in my reader, with thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *