By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

Server has gone away error when importing a large SQL file.

P: 8
Hi folks,

I've searched high and low for solution. Here's the skinny:
MySQL Server 5.0 on Windows Server 2003
I have a 156MB sql file I'm trying to import using mysql -uusername -p database < dump.sql
I get an error response of: Error 2006 <HY000> at line 145: Mysql Server has gone away.

I already increase the max_allowed_packets to 250MB. And I've already checked the error logs and there are no messages.

I can't split up the file because a table in the database is 135mb to begin with.

Please help.

THanks
Jan 8 '09 #1
Share this Question
Share on Google+
2 Replies


Atli
Expert 5K+
P: 5,058
Hi.

Try using the SOURCE command from within the MySQL CLI.
(Make sure you log in with a user that has the required privileges to execute the statements in your file.)
Expand|Select|Wrap|Line Numbers
  1. mysql> SOURCE /path/to/file.sql;
Note that this will simply execute the SQL in the file as if you had copy/pasted it into the MySQL CLI window.

You might also want to make sure the that max_allowed_packet increase has taken effect.
Expand|Select|Wrap|Line Numbers
  1. mysql> SHOW VARIABLES LIKE 'max_allowed_packet';
Should show you the value in bytes.
Jan 8 '09 #2

P: 8
Thanks Atli. It turns out I had to edit the my.ini file and my syntax was wrong.
Jan 9 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.