0

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

1 Answer 1

1

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.

4
  • so the next line of could should be mysqldump -P 33306 -h localhost -u dbuser db ?
    – Yusuf Ali
    May 3, 2013 at 17:15
  • Yes, something like that.
    – Sven
    May 3, 2013 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, 2013 at 18:45
  • 1
    Try mysqldump -P 33306 -h 127.0.0.1 -u dbuser db to avoid a connection via a local socket.
    – Sven
    May 3, 2013 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .