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.

Database restoration

Discussion in 'General Discussion' started by DevinC, Aug 2, 2006.

  1. DevinC

    DevinC Member

    Joined:
    Jul 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I am having some trouble understanding what I need to do.

    Using cPanel's backup feature, I have already downloaded a backup copy of one MySQL database (in compressed GZ format) to my local machine. I've tried using either Winzip or WinRAR to extract the content but all I am seeing is a file within that has unknown file extension.

    I need to uncompress the database into a folder with all table still intact. Ie. a bunch of file ending with MYD, MYI, and FRM extensions.

    What tools and steps are necessary to achieve this objective?

    I am using Windows 2000.

    Thanks,

    Devin
     
  2. elleryjh

    elleryjh Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    The file that you downloaded and gunzipped should be a mysql dump, that is a text file containing the information to restore the database.

    Try opening it in notepad or a text editor to view it.

    To restore it, FTP it to your server, then SSH to your server and use the command:
    Code:
    mysql -u user_name -D db_name -p < the_sql_file
    Or upload it with phpMyAdmin's SQL tab.

    cPanel does not provide you access directly to the raw MYI, etc database files which is probably for the best.
     
  3. DevinC

    DevinC Member

    Joined:
    Jul 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi elleryjh,

    Thank you for the instruction. Is it possible to do a dump directly from MySQL server already installed on my local machine?

    My shared webhost provider do not permit shell access or has the phpMyAdmin tool available.

    Thanks,

    Devin
     
  4. xalex

    xalex Registered

    Joined:
    Jun 22, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
  5. DevinC

    DevinC Member

    Joined:
    Jul 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello, I had a look at the script and its doing the exact opposite of what I am trying to accomplish.

    I've found some following information in MySQL Reference Manual:

    You can also store the dump in a file, transfer the file to the target machine, and then load the file into the database there. For example, you can dump a database to a compressed file on the source machine like this:

    shell> mysqldump --quick db_name | gzip > db_name.gz

    Transfer the file containing the database contents to the target machine and run these commands there:

    shell> mysqladmin create db_name
    shell> gunzip < db_name.gz | mysql db_name


    I am repeatly receiving SQL syntax error message. I don't know what the problem is with my syntax as I have already tried everything I can think of, including full path.

    I am thinking that this issue is more about MySQL rather than cPanel's so I will post my question on MySQL forum.

    Thanks,

    Devin
     
Loading...

Share This Page