0

I have seen a lot of posts that claim they are running an RDS instance of MySql in which they cannot connect to, but I am not running RDS.

I used my EC2 insance to host my wordpress blog which was installed using the Web Platform Installer.

This setup the wordpress schema and data that I needed and I have been running it for a couple years.

I want to be able to access this database remotely instead of only logging into my server.

I have checked and have the following users

root
wpadmin

I have also verified that the port specified in the mysql config is the standard 3306 and I have setup an Inbound Firewall rule to allow 3306 through.

When I try to connect from MySql Workbench, I get the following error message:

enter image description here

Number 3 Is particularly one that I do not know how to check, but I do know that MySql is running and that it is running on 3306. Additionally, I know I am using the correct password.

enter image description here

When I try to connect, the prompt looks like this. Do I need to do something to grant Mysql user permissions or anything?

TheJediCowboy
  • 8,924
  • 28
  • 136
  • 208
  • Can you post results of `SHOW GRANTS;` query into your question? Also is your EC2 security group configured to allow for access on port 3306? Honestly, you would probably be MUCH better of trying to make DB connection over an SSH tunnel such that you don't need to open up your DB to potential access from outside the localhost. – Mike Brant Apr 09 '14 at 16:10
  • It shows me GRANT ALL PRIVELEGES ON *.* to 'root'@'localhost' identified by ' WITH GRANT OPTION – TheJediCowboy Apr 09 '14 at 16:20
  • I am only planning on opening this for a very short time and then removing it, if I can't figure this out, I might try the route of setting up an SSH tunnel. – TheJediCowboy Apr 09 '14 at 16:21

1 Answers1

2

Based on your GRANT information, you have at least the problem of root user only having access privileges from localhost. You would need to create a root@% user (or a more specific host/IP instead of % if you have a reliable address). That would allow external access so long as your EC2 security group also allow access on port 3306 (either globally or to a more restrictive IP address or IP range).

Of course the security implication here is that you are opening up access to MySQL that you might not want to make more accessbile to potential attackers. For this reason, I would recommend you access your DB via SSH tunnel, which is supported by MySQL workbench. This will in essence allow you to shell into the host your your access key and then access as root@localhost.

Mike Brant
  • 70,514
  • 10
  • 99
  • 103