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.

Large Mysql restore file - timeout

Discussion in 'General Discussion' started by jeroman8, Jul 22, 2004.

  1. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    how do I restore a mysql database from a backup file if the file is
    over 150 MB ? It just won't do it, it takes forever and then I get a
    error of some sort. I guess the file is to big but there must be another
    way doing this and not split the files upp in 50 pieces.

    Oh, I tried doing this in PHPMyadmin.
    Can I do it in SSH or something and if so how ?

    Error:
    Fatal error: Maximum execution time of 300 seconds exceeded in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/read_dump.lib.php on line 186


    Thanks guys !

    Regards Jerry
     
  2. ChemicalWH

    ChemicalWH Active Member

    Joined:
    Mar 4, 2004
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Hey,

    It's pretty easy to restore a MySQL Database in ssh,

    just upload the SQL file to the server and run the following command in ssh:

    mysql -uUSERNAME -p newdbname < /path/to/dump.sql

    Replace the USERNAME, newdbname and the path/to/dump.sql to your own details
    it'll ask you for the database password and after filling that in it'll restore the db

    Good Luck,

    Ruud Goedhart
     
  3. damainman

    damainman Well-Known Member

    Joined:
    Nov 13, 2003
    Messages:
    515
    Likes Received:
    0
    Trophy Points:
    16
    there is no space between the -u and USERNAME .. is that a typo is that suppose to be like that?

    Also for the new database name do I need to create it as username_databasename.sql or username_databasename or just databasename

    Thank you in advance :)
     
  4. Silver_2000

    Silver_2000 Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    338
    Likes Received:
    1
    Trophy Points:
    18
    when doing restore from ssh you can make the db name whatever you want BUT if you want it to be accessible from a certain account you will want the accountname in the dbname

    No need to put .sql at the end
     
  5. AlexV.

    AlexV. Well-Known Member

    Joined:
    Jun 15, 2006
    Messages:
    212
    Likes Received:
    1
    Trophy Points:
    16
    Was the mysql dump file compressed? phpMyAdmin should support gzip imports.
     
Loading...

Share This Page