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.

MySQL Transfer

Discussion in 'General Discussion' started by HH-Steven, Feb 11, 2005.

  1. HH-Steven

    HH-Steven Well-Known Member

    Joined:
    Aug 29, 2004
    Messages:
    284
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Ok, i have a customer whos wanting to upload a fairly big database. I told him to upload it to his public_html folder with the understanding that i can use ssh to add it to the sql folder etc........

    Hes uploaded it but now im stumped, is there anyone who could give me a step by step on how to complete this?

    DB - techmob_ipbnuke.gz (and is located in the customers public_html directory)

    Thanks in advance for any help.

    Steven
     
  2. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    tar xvzf techmob_ipbnuke.gz

    mysql -uUSERNAME -pPASSWORD DATABASE_NAME < YOUR_FILE/YOUR_FILE.sql

    Where YOUR_FILE/YOUR_FILE.sql is what you wouild get from first command.
    Substitute USERNAME , PASSWORD, DATABASE_NAME with the values that you have for the user :)

    Anup
     
  3. HH-Steven

    HH-Steven Well-Known Member

    Joined:
    Aug 29, 2004
    Messages:
    284
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Ok, tried that, this is what i get after the first command :

    root@server1 [/home/techmob/public_html]# tar xvzf techmob_ipbnuke.gz
    tar: This does not look like a tar archive
    tar: Skipping to next header
    tar: Archive contains obsolescent base-64 headers
    tar: Error exit delayed from previous errors


    Any suggestions?
     
  4. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    Google around :)

    Anup
     
  5. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    It didn't work because, like the error said, it is not a tar file. Try this:

    gunzip techmob_ipbnuke.gz

    mysql user_dbname -u user -p**** < /home/username/techmob_ipbnuke
     
  6. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    tar <options>

    x - extract files from an archive
    v - verbose
    z - filter the archive through gzip

    It always worked for me provided the file was not corrupted (many reasons for that ... something silly like uploading the compressed archive in ascii mode)

    Anup
     
  7. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    I may be wrong, but I am pretty sure that should only work on a file that was tarred AND gzipped. In this case, the file is only gzipped.
     
  8. HH-Steven

    HH-Steven Well-Known Member

    Joined:
    Aug 29, 2004
    Messages:
    284
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Thanks for the reply guys, ill have to try them tomorrow, ill let you know.

    Cheers
    Steven
     
  9. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    Login as root:

    gunzip techmob_ipbnuke.gz


    If they haven't added the db in cpanel yet, with a user, password then..

    # mysql

    > CREATE DATABASE techmob_ipbnuke;
    > GRANT ALL ON techmob_ipbnuke.* TO $user@localhost IDENTIFIED BY '$password';
    > FLUSH PRIVILEGES;
    > quit

    # mysql techmob_ipbnuke < techmob_ipbnuke (the last one is the name of the sql file)

    Change $user, $password to the real database user and their password respectively, which they can let you know if you can't see it by checking their mysql connection script that is located on their account, if it is there.

    Otherwise if the db exists already , just

    # mysql techmob_ipbnuke < techmob_ipbnuke

    Should do.
     
    #9 DigitalN, Feb 11, 2005
    Last edited: Feb 11, 2005
Loading...

Share This Page