The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem Restoring A Database

Discussion in 'Database Discussions' started by joben1, Feb 24, 2008.

  1. joben1

    joben1 Member

    Joined:
    Aug 14, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    When trying to restore a database in ssh I get the following error:

    It seems that max_allowed_packet needs increasing. How do I do that?

    I am using this command:
    mysql -h localhost -u root DATABASE < DATABASE.sql
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    I believe the default is 1mb, you would set the value from ssh.

    mysql --max_allowed_packet=16M (or whatever value needed to run)

    If you need to load the variable all the time then simply add max_allowed_packet into my.cnf as well.

    Yep the default is 1mb:
    mysql> show variables like 'max%' ;
     
    #2 jayh38, Feb 24, 2008
    Last edited: Feb 24, 2008
  3. joben1

    joben1 Member

    Joined:
    Aug 14, 2007
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    When I do that I get: "Welcome to the mysql monitor." - and a load of other help info.
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Ahh ok..

    Then enter the mysql monitor and use this instead:

    mysql>set max_allowed_packet = 1600000;

    Verify the change before and after:
    mysql>show variables like 'max%';

    ooops , thats 1.6M I showed. So edit the size as you need.
     
    #4 jayh38, Feb 24, 2008
    Last edited: Feb 24, 2008
  5. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    you are very much welcome!
     
Loading...

Share This Page