I should note that I use this basic command (minus the private key) to establish tunnels to non-EC2 serves with success all the time. If I let it time out I get the same basic error: Lost connection to MySQL server at 'reading initial communication packet', system error: 35Īnd the ssh command reports: channel 2: open failed: connect failed: Connection timed out If I kill the tunnel I get the following message: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 This is the ssh command I am using to establish the tunnel on my Mac: ssh -nNT -L 3306:IPADDRESS:3306 -i /path-to/key.pem then attempt to connect to MySQL. I have verified that the user (currently using ec2-user for testing will use a user with restricted permissions for production) can run MySQL from the command line on EC2 and has no problems making an SSH connection using the private key. Obviously we don't want this hole in the firewall for production. I opened 3306 in the AWS settings and I am able to connect to MySQL with the user and password with no issues. I have verified that the MySQL user has appropriate permissions. The instance is running Amazon Linux, MySQL is 5.5.42. We have other servers where we do this with no issues, but for some reason on EC2 it's not working. For security reasons we want to connect to MySQL running on EC2 over ssh.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |