SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    restoring huge database

    I have a 600mb sql file, trying to restore through command line and I get this error after a minute:

    ERROR 1153 at line 339011: Got a packet bigger than 'max_allowed_packet'

    we with it has to do with a binary field, I dunno, anyone see this before?
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    SitePoint Member
    Join Date
    May 2004
    Location
    Stockholm Sweden
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dethfire
    I have a 600mb sql file, trying to restore through command line and I get this error after a minute:

    ERROR 1153 at line 339011: Got a packet bigger than 'max_allowed_packet'

    we with it has to do with a binary field, I dunno, anyone see this before?
    This is general setting for the MySQL DB how big one statement can be. The default for the server variable max_allowed_packet is 1Mb if I remember correctly. You can change this setting for each connection by setting it from the mysql prompt using:
    mysql> SET max_allowed_packet = xxx;

    If you have used the mysql extended insert format (mysqldump -e) then this problem gets more common since mysql considers everything up until the ending ';' to be one statement for good and bad.

    So if you got the memory for it change the max_allowed_packet while you are restoring the file. This will usually suffice but if not you will have to break the extended format into several inserts instead or if you have the ability to redo the dump but without using the extended insert format.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •