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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AtTheEnd
    New Member
    • Jan 2009
    • 8

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

    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_pac kets 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
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    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.)
    [code=mysql]mysql> SOURCE /path/to/file.sql;[/code]
    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_pac ket increase has taken effect.
    [code=mysql]mysql> SHOW VARIABLES LIKE 'max_allowed_pa cket';[/code]
    Should show you the value in bytes.

    Comment

    • AtTheEnd
      New Member
      • Jan 2009
      • 8

      #3
      Thanks Atli. It turns out I had to edit the my.ini file and my syntax was wrong.

      Comment

      Working...