Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a similar problem from this question How to dump remote database without mysqldump?

How ever when I run

 ssh -f L 3306:localhost:3306 user@remoteserver -N

I am receive the following error

bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 3306
Could not result local forwarding
share|improve this question

1 Answer 1

up vote 1 down vote accepted

You are likely already running a local MySQL server that's using port 3306.

You can just change the local port for the tunneling like so:

  ssh -f -L 33306:localhost:3306 user@remoteserver -N

but of course you must point your local tools to port 33306 then.

share|improve this answer
    
so the next line of could should be mysqldump -P 33306 -h localhost -u dbuser db ? –  Yusuf Ali May 3 '13 at 17:15
    
Yes, something like that. –  SvW May 3 '13 at 17:16
    
I get an error 'msqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect` –  Yusuf Ali May 3 '13 at 18:45
1  
Try mysqldump -P 33306 -h 127.0.0.1 -u dbuser db to avoid a connection via a local socket. –  SvW May 3 '13 at 18:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.