Irish SEO,  Marketing & Webmaster Discussion
 

 

Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Server / Technical Administration Tips and Queries


Notices

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-01-2008, 09:29 PM
Coder
 
Join Date: Sep 2007
Posts: 66
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
sullyman1 will become famous soon enough
Default Ssh

Hi Folks,

How do i use SSH to connect to a server to backup a MySQL DB.

I am using a Windows machine and want to connect to a Hosting365 account to backup a database.

From reading up, i have downloaded the program Putty and entered correct Host name etc. but i am getting connection refused.

Is Putty the correct program to use? Am i on the right track.

Thanks,
S
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 10:05 PM
paul's Avatar
Web Whore
 
Join Date: Dec 2006
Location: .de
Posts: 982
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
paul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud of
Default

read this MySQL AB :: MySQL 5.0 Reference Manual :: 4.5.1 mysql — The MySQL Command-Line Tool
__________________
my sites :
irish poker / irish jobs / seo faq / advertise jobs free / green card / skiing
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-01-2008, 10:12 PM
Coder
 
Join Date: Sep 2007
Posts: 66
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
sullyman1 will become famous soon enough
Default

Thanks Paul

I found those commands from searching online earlier but my problem is actually getting into a Shell command environment.

Hosting365 enabled Shell on my account earlier but when i run Putt now with correct login account, the Putty Window just disappears after entering login password

Any idea?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-01-2008, 01:24 AM
Frodo's Avatar
Ciaran Rooney - Weeno Ltd
 
Join Date: Jan 2007
Location: London
Posts: 336
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Frodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud of
Send a message via MSN to Frodo Send a message via Skype™ to Frodo
Default

Sounds like a wrong password/user really. If you are getting prompted for your user and pass then your connection is ok but some severs will force a client close on entering a wrong user pass combo as a security feature. I'd contact h365 and confirm you are using the right user and password, they may not be the same as your account login.
__________________


Last edited by Frodo; 05-01-2008 at 01:12 AM. Reason: spelling
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-01-2008, 09:46 AM
Wannabe Geek
 
Join Date: Feb 2007
Posts: 189
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
hosting365 will become famous soon enough
Default

Just to confirm, once SSH is active, use your FTP user/pass combo to get in.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 05-01-2008, 01:16 AM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 1,774
Nominated 2 Times in 1 Post
TOTW/F/M Award(s): 0
Forbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond repute
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

also change your putty settings to not close the window on exit ... might give you a useful bit of info
__________________
Forbairt Media | Web Design & Development Galway / Dublin, Ireland - coming soon ... ( vague but descriptive isn't it )
Recent Work: Safari Club African Safari Holidays - South Africa Safaris
Other Stuff: FluffyLinkulator Rapid Inclusion Service Tools
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 05-01-2008, 04:15 PM
Coder
 
Join Date: Sep 2007
Posts: 66
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
sullyman1 will become famous soon enough
Default

Thanks guys.

Managed to login over SSH with putty but still having problems.

I have a few domains in my account. Do i need to CD into a certain directory.

I am trying to use this command

mysqldump -u username -pPassword Databasename > /hsphere/local/home/Webserver/bckdb/test.sql


to backup my MySQL DB but getting the following error:

Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect


Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 06-01-2008, 12:50 AM
Frodo's Avatar
Ciaran Rooney - Weeno Ltd
 
Join Date: Jan 2007
Location: London
Posts: 336
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Frodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud ofFrodo has much to be proud of
Send a message via MSN to Frodo Send a message via Skype™ to Frodo
Default

I run this (extract only) on a cron to do daily back ups, I change to the directory I'm backing up to first thats only difference to yours, oh and no space between -u and username (thought thats probably just a typo here). But this might help you.

Code:
#!/bin/bash
# backup.sh by Ciaran

# file paths
ECHO=/bin/echo
LS=/bin/ls
DATE=/bin/date

# script variables
DATECODE=`date +%Y-%m-%d`
BACKDIR=/media/WD1/backUp/

# do the work
$ECHO `date` ":-- ==== starting backup ==== --"

###############################################
cd "$BACKDIR"
mkdir "$DATECODE"

$ECHO `date` ": Web Files Backup"
cd /srv
zip -r srv * >> /log.log
mv srv.zip $BACKDIR/$DATECODE

$ECHO `date` ": Apache Setup Backup"
cd /etc/apache2
zip -r apache * >> /log.log
mv apache.zip $BACKDIR/$DATECODE


$ECHO `date` ": MySQL backup"
cd $BACKDIR/$DATECODE
mysqldump -uusername -ppassword databasename > databasename.sql
__________________

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 06-01-2008, 08:31 AM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 1,774
Nominated 2 Times in 1 Post
TOTW/F/M Award(s): 0
Forbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond repute
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

Quote:
Originally Posted by sullyman1 View Post
mysqldump -u username -pPassword Databasename > /hsphere/local/home/Webserver/bckdb/test.sql

to backup my MySQL DB but getting the following error:

Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect

Any ideas?
I may be wrong but you may have to specify the host as well a lot of webhosts don't let you connect to localhost. -h should be what you're after
__________________
Forbairt Media | Web Design & Development Galway / Dublin, Ireland - coming soon ... ( vague but descriptive isn't it )
Recent Work: Safari Club African Safari Holidays - South Africa Safaris
Other Stuff: FluffyLinkulator Rapid Inclusion Service Tools
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 06-01-2008, 08:34 AM
Forbairt's Avatar
respect my AW-THOR-IT-AYY
 
Join Date: Jun 2007
Location: My Office, Dublin
Posts: 1,774
Nominated 2 Times in 1 Post
TOTW/F/M Award(s): 0
Forbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond reputeForbairt has a reputation beyond repute
Send a message via AIM to Forbairt Send a message via MSN to Forbairt Send a message via Yahoo to Forbairt Send a message via Skype™ to Forbairt
Default

Quote:
Originally Posted by Frodo View Post
I run this (extract only) on a cron to do daily back ups, I change to the directory I'm backing up to first thats only difference to yours, oh and no space between -u and username (thought thats probably just a typo here). But this might help you.

Code:
#!/bin/bash
# backup.sh by Ciaran

# file paths
ECHO=/bin/echo
LS=/bin/ls
DATE=/bin/date

# script variables
DATECODE=`date +%Y-%m-%d`
BACKDIR=/media/WD1/backUp/

# do the work
$ECHO `date` ":-- ==== starting backup ==== --"

###############################################
cd "$BACKDIR"
mkdir "$DATECODE"

$ECHO `date` ": Web Files Backup"
cd /srv
zip -r srv * >> /log.log
mv srv.zip $BACKDIR/$DATECODE

$ECHO `date` ": Apache Setup Backup"
cd /etc/apache2
zip -r apache * >> /log.log
mv apache.zip $BACKDIR/$DATECODE


$ECHO `date` ": MySQL backup"
cd $BACKDIR/$DATECODE
mysqldump -uusername -ppassword databasename > databasename.sql
Cheers for that I will probably start using that in conjunction with a cron from my local machine to pull down the backups and then store them offline.
__________________
Forbairt Media | Web Design & Development Galway / Dublin, Ireland - coming soon ... ( vague but descriptive isn't it )
Recent Work: Safari Club African Safari Holidays - South Africa Safaris
Other Stuff: FluffyLinkulator Rapid Inclusion Service Tools
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
changing permissons via ssh Cormac Server / Technical Administration Tips and Queries 5 15-08-2006 11:29 PM


All times are GMT +1. The time now is 02:11 AM.


Powered by: vBulletin Version 3.7.2, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.

Search Engine Friendly URLs by vBSEO 3.2.0