+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 11

Thread: Installing a mysql DB via SSH

  1. #1
    Cormac's Avatar
    Cormac is offline Cormac Moylan Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of
    Join Date
    Jan 2006
    Location
    Cork
    Posts
    1,260
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Installing a mysql DB via SSH

    Hi guys,
    I have a SSH session open on my VPS. I have cd'd into the httpdocs folder in which I have placed a file called db.sql. I have created a DB via my control panel with the necessary username and password.

    I'm running this command:
    mysql -u DBusername -p DBpassword DBname < db.sql

    But I'm getting an error stating "command not found". What am I doing wrong?

  2. #2
    blacknight's Avatar
    blacknight is offline Web Slave blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    7,908
    Thanks
    9
    Thanked 8 Times in 7 Posts

    Default

    Is the command "mysql" in your path?
    ie. if you start typing mysql and hit the tab key, does it autocomplete?

  3. #3
    Cormac's Avatar
    Cormac is offline Cormac Moylan Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of
    Join Date
    Jan 2006
    Location
    Cork
    Posts
    1,260
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No, the command mysql isn't in the path.
    After looking into SSH further it seems that I have to be in the mysql directory in order to run the command (makes sense now of course!) but I can't actually find the mysql directory.

    if you start typing mysql and hit the tab key, does it autocomplete?
    No.

  4. #4
    shortword is offline Coder shortword will become famous soon enough
    Join Date
    Jun 2008
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Cormac,

    Is that a plesk vps? Are you loggin in as a user or as root?

    Paul

  5. #5
    Cormac's Avatar
    Cormac is offline Cormac Moylan Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of
    Join Date
    Jan 2006
    Location
    Cork
    Posts
    1,260
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Paul,
    I'm logged in as a user with /bin/bash (chrooted) access on Plesk.

  6. #6
    shortword is offline Coder shortword will become famous soon enough
    Join Date
    Jun 2008
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thats the problem then, mysql isn't included in the chrooted environment.

    If you pop on as root it'll work just fine.

    Paul

  7. #7
    Cormac's Avatar
    Cormac is offline Cormac Moylan Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of
    Join Date
    Jan 2006
    Location
    Cork
    Posts
    1,260
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    When you say root do you mean the root account of the server or a root account relating to the specific domain? I have logged in as the root of the server but then I am clueless as to do next. I'm not sure how I navigate to the msql directory from there.

  8. #8
    shortword is offline Coder shortword will become famous soon enough
    Join Date
    Jun 2008
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You don't need to navigate anywhere :-)

    Simply run the command from your first post and it should be fine.

    Paul

  9. #9
    Cormac's Avatar
    Cormac is offline Cormac Moylan Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of Cormac has much to be proud of
    Join Date
    Jan 2006
    Location
    Cork
    Posts
    1,260
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Mmm, when I login and run the command mysql -u DBuser -p DBpass DBname < blog.sql

    I get the error -bash: blog.sql: No such file or directory

    That's why I thought I might need to be in the httpdocs root or a similar dir to run the command successfully.

    (thanks for the help btw)

  10. #10
    shortword is offline Coder shortword will become famous soon enough
    Join Date
    Jun 2008
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, I was going to mention that :-)

    You can give the full path to the file if you like. I _think_ the vhosts are in /var/www/vhosts/ but I can't recall.

    Paul

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Similar Threads

  1. Analytics - Installing UTM tracking code?
    By Wenlock in forum Search Engine Optimisation
    Replies: 1
    Last Post: 19-07-2008, 11:16 AM
  2. Installing Ubuntu
    By TheMenace in forum Desktop Computer Issues
    Replies: 4
    Last Post: 23-11-2007, 02:35 PM
  3. Installing ISAPI Rewrite
    By glengara in forum Server / Technical Administration Tips and Queries
    Replies: 4
    Last Post: 01-10-2007, 11:38 AM
  4. Installing MySQL on Mac?
    By ButtermilkJack in forum Coding Help
    Replies: 6
    Last Post: 25-01-2007, 09:46 PM
  5. Installing a Web Mail Client
    By Cormac in forum Server / Technical Administration Tips and Queries
    Replies: 10
    Last Post: 18-08-2006, 04:51 PM

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Optimization by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64