Take the 2-minute tour ×
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:127.0.0.1:3306 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 127.0.0.1 -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 = 127.0.0.1

in hosts.allow

mysqld:127.0.0.1

Can't figure what is wrong.

share|improve this question

migrated from stackoverflow.com 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

 
discard

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