-1

(help, patience and mercy... begginer lost haha)

-Ok heres the deal, im trying to connect a EC2 Instance to MySQL throught SSH in MySQL Worckbrench

-I set up the configurations this way

SSH Hostname: My Public DNS

SSH Username: ec2-user

and the keyfile of instance

MySQL Hostname: 127.0.0.1

MySQL Serverport: 3306

Username: root

(This last part was leave it as default)

-When i try to connect it pop's up this error:

"Failed to Connect to MySQL at 127.00.1:3306 through SSH tunnel at my server dns whit user root Lost connection to MySQL server at "reading initial communication packet", system error: 0

-I find some posible solution, but i dont know if they dont work for my case or i just get them wrong

-The most ussual solution suggest to change the bind addres of the SQL my.ini from 127.0.0.1 to 0.0.0.0 but in the 5.6 version of MySQL The default address is al ready set 0.0.0.0. (http://dev.mysql.com/doc/refman/5.1/en/server-options.html) and i cant even find the bind addres section in my.ini

I find everything in order in my EC2 server and i can conncet via ssh throught the comand, so i guess the ssh configuration is in order too

What im missing?

Santiago Ros
  • 9
  • 1
  • 2
  • 1
    typo... typo everywhere... – tpml7 Dec 18 '14 at 22:16
  • `and the keyfile of my server` <-- If that's not a typo.. you're doing it wrong. You should have a key you created for the CLIENT, then you put the public portion of that key into authorized_keys on the server. –  Dec 18 '14 at 23:25
  • it's the public key of my ec2 instance. As long as i see it's the key i have to use there. Sorry for the bad english. – Santiago Ros Dec 18 '14 at 23:33

2 Answers2

0

When I had that problem, it was because the host name used in the 'connection' part of you mysql client wasn't resolving properly its name in the MySQL's server to the server itself.

Usually I had to change the /etc/hosts and add localhost to the 127.0.0.1 entry.

Your case doesn't seem to be the same as you are using the ip 127.0.0.1?!

BTW, have you mistyped 127.00.1:3306? There is a dot missing in there.

0

Try making the tunnel yourself with

ssh -f -L 3306:localhost:3306 11.22.33.44 -N

Then just connect to localhost:3306 without SSH encryption.

user3850506
  • 179
  • 3
  • Begginer question: It dont allows me: "Permission denied (publickey)." Where do i put the publickey? – Santiago Ros Dec 18 '14 at 22:51
  • 1
    You generate it with ssh-keygen and add it with ssh-copy-id user@host also it should be ssh -f -L 3306:localhost:3306 user@11.22.33.44 -N if you dont use the same username on both machines. – user3850506 Dec 18 '14 at 22:57