Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I got some troubles establishing connect to remote database via ssh tunnel.

Open ssh tunnel

ssh -fNg -L 3307: user@remote-host

Check it

netstat -lep --tcp

All OK

tcp  0 0 *:3307 *:* LISTEN developer 119449 5225/ssh

Try to connect

mysql -u dbuser -h -p -P 3307

Got error

ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

in my.cnf

bind-address =

in hosts.allow


Can't figure what is wrong.

share|improve this question

migrated from Mar 14 '13 at 19:43

This question came from our site for professional and enthusiast programmers.

Try adding -v to your ssh command. Also, check that ssh port forwarding works, using another service in that same server –  golimar Mar 14 '13 at 16:22

1 Answer 1

Can you change the bind-address=localhost and restart mysql server. You can go through this one.

share|improve this answer

Your Answer


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