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.

Import database

Discussion in 'Database Discussions' started by ASTRAPI, Jun 6, 2009.

  1. ASTRAPI

    ASTRAPI Well-Known Member

    Joined:
    Jul 8, 2008
    Messages:
    321
    Likes Received:
    0
    Trophy Points:
    16
    Hello

    It will work if i try to restore a database using GUI cpanel or i will need ssh?

    The database is 120mb.

    Thank you
     
  2. chinmay

    chinmay Well-Known Member

    Joined:
    Jul 22, 2008
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    localhost
    Yes, you can restore/import the database through phpmyadmin. It would get restored.

    If you are familiar with the SSH and the linux commands, you can even give it a try with restoring the database via SSH. The command to restore the database is

    mention the absolute path of database.sql file.
     
  3. Eric

    Eric Administrator
    Staff Member

    Joined:
    Nov 25, 2007
    Messages:
    746
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    It might work in phpmyadmin, but it will work for sure with SSH. I would strongly recommend using SSH.

    You can use something like this example below. Change out the parts in <>'s with your information.
    Code:
    eric@svr01 ~ $ mysql -u <username_dbuser> -p <username_dbname> < sqlfilename.sql
    It should prompt you for the password and return another ssh line when it's done. (And with 120megs it might take a little while)
     
  4. linux7802

    linux7802 Well-Known Member

    Joined:
    Dec 14, 2007
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Solution

    Yes its better if you upload the database backup file on your server in .sql format and restore it from shell.

    Gunjan@servers~]$mysql username_databasename < sqlfilename.sql

    If you are not having Server access :( then follow the steps.

    1) Upload the sql file in .sql format under your hosing account.

    2) Provide database name and .sql file name to your hosting provider and ask
    them to restore it under your database name.

    Hope it will solve your issue... :)
     
  5. ASTRAPI

    ASTRAPI Well-Known Member

    Joined:
    Jul 8, 2008
    Messages:
    321
    Likes Received:
    0
    Trophy Points:
    16
    Ok ssh seems to be the best solution :)

    Thanks all of you :)
     
Loading...

Share This Page