Monthly Archives: January 2013

You are browsing the site archives by month.

ERROR 2006 (HY000) at line xx: MySQL server has gone away – MySQL and BIG dumps

Every time I re-do my dev machine I ultimately get “ERROR 2006” once I try to import a SQL dump that is too big. It’s a simple fix. You just have to modify your my.ini config file located in the Data directory for MySQL. The default directory is  C:\Program Files\MySQL\MySQL Server 5.5
(or etc/my.cnf on linux)
Then just make a quick change (or addition)

max_allowed_packet = 64M

Restart your MySQL server Service and Bob’s your Uncle! Depending on how you installed MySQL, this value may already have been set to 1M, or it may be missing all together, so don’t hesitate in adding the setting should it be missing.

MySQL Dump file troubles, a dashes dilema

I really hate looking (or being) stupid. Nevertheless it happens from time to time. Most (if not all) times they are avoidable events. Had my observation of what the MySQL command line response was trying to tell me been a little better, perhaps my Google searching Kung-Fu failure would not have added additional salt to the wound.

When attempting to import data from a SQL dump I was getting the following error(s):

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

or

mysql: unknown option

As it turned out, it was a simple matter of syntax minutia I was overlooking.  Since Google couldn’t help me save myself, I’m hoping that I can list a few of the deviations of syntax for importing a dump file and it will help somebody whom comes across it to save a little face.

RIGHT:
mysql -uroot -ppassword test < test.dmp
mysql -uroot –password=password test < test.dmp
mysql –user=root –password=password test < test.dmp
mysql -uroot –password=password test < test.dmp

WRONG:
mysql -uroot -password=password test < test.dmp
mysql -uroot –ppassword test < test.dmp
mysql –uroot -password=password test < test.dmp
mysql -user=root –password=password test < test.dmp

May the Computer gods (Google?) shine upon those of you having a dashes dilema with MySQL dump files and bring you here for salvation.  🙂