Importing my sql databse using SSH command

Discussion in 'Site & Server Administration' started by bbrian017, Jan 9, 2010.

  1. #1
    I'm trying to upload a file and import a database to my php admin but SSH is saying no such file or directory.

    I'm using the following

    The file is in the directory of the specific site should it be somewhere else?

    Any help would be awesome!

    Thanks,

    Brian
     
    bbrian017, Jan 9, 2010 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    I doubt that you have the correct path. It should be something along the lines of:

    /home/user/public_html/file.sql

    You are specifying an absolute path. If you are already in the users home directory, you would use something like this:

    public_html/file.sql

    As that would be relative to the location you are in.
     
    RHS-Chris, Jan 9, 2010 IP
  3. bbrian017

    bbrian017 Well-Known Member

    Messages:
    2,990
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    170
    #3
    Right now I'm logged in SSH as root!

    I uploaded the file I need to import to the root of the websites /public_html/ folder.

    When you mentioned /home/user/public_html/file.sql

    Should I replace the /user/ with the website database username? Or should it be kept simply /user/

    Could it be because the import file isn't named the same as the database I'm trying to import it to?
     
    bbrian017, Jan 9, 2010 IP
  4. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #4
    You should replace it with the user name for the website. If you are in ssh, tell me the output of this command:

    pwd
     
    RHS-Chris, Jan 9, 2010 IP
  5. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #5
    why dont u use cd command and get into the directory first and then just specify the name
     
    Bohra, Jan 9, 2010 IP
  6. bbrian017

    bbrian017 Well-Known Member

    Messages:
    2,990
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    170
    #6
    That actually sounds like a good idea

    I ended up taking the database in 7 sections and imported each section at a time.
     
    bbrian017, Jan 9, 2010 IP