0
votes

I am running MySQL on an Amazon AWS Instance. I was able to previously connect to the MySQL Database via MySQL Query Browser. Now I am traveling outside the U.S. and I am having trouble connecting via the Query Browser. I am able to use Terminal to create an ssh connection and then login to MySQL, so it does not appear to be a larger issue with the MySQL Database.

Has anyone else had a similar problem? Any ideas how I can fix this?

This is the error I get from the MySQL Browser

Your connection attempt failed for user 'admin' from your host to server at ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com:3306: Can't connect to MySQL server on 'ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com' (4)

Please: 1 Check that mysql is running on server ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com

2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)

3 Check the admin has rights to connect to ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com from your address (mysql rights define what clients can connect to the server and from which machines)

4 Make sure you are both providing a password if needed and using the correct password for ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com connecting from the host address you're connecting from

The only possible problem I see could be #4, but I ran and re-ran this command via Terminal: grant all privileges on *.* to 'admin'@'%' identified by '<pass>' with grant option;

This sounds by design: mySQL is usually closed to the outside world for security reasons. Have you been able to connect directly to mySQL from inside the US?Pekka
Okay, I take the blame for this one. I thought port 3306 was open for everywhere, but I had to assign it my IP address to allow traffic.Chris
@Chris Hi Chris, running through the same problem how did you assign the port to the ip address? Thanks!mongotop
I had to get my ip address (www.whatsmyip.org) and then add that as a 3306 port in my security group. If your ip is 12.34.56.78, choose "MySQL" from the "Create a New Rule" dropdown menu in you Security Group's "Inbound" tab. Then add 12.34.56.78/32 as the Source, click "Add Rule" then click "Apply Rule Changes"Chris