Solved

PHP connection to remote AWS MySQL RDS

Posted on 2016-11-10
4
175 Views
Last Modified: 2016-11-10
I have a client using a MySQL database on Amazon Web Services RDS. I need to connect to that database from my own shared hosting server on Namecheap.com. I have been able to connect from my desktop successfully using MySQL Workbench and have created a php connection script in Workbench. However, my connection is being rejected with the following error:
mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on 'removed4security.us-east-1.rds.amazonaws.com' (110)

Open in new window

The user privileges are set to accept connection from host %.

I have avoided using AWS in the past as they seem to have reinvented the wheel in hosting administration. Nothing, and I mean nothing, in the AWS control panel even resembles anything I've ever used before. Even the terminology is unfamiliar. Even though I've set up dozens on databases for remote and local access, I am in unfamiliar territory with this system.

Any suggestions?
0
Comment
Question by:Kim Walker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 41883048
You should first verify that NameCheap allows you to connect to external databases.  Some hosts do not allow that.
0
 
LVL 14

Expert Comment

by:Phil Phillips
ID: 41883073
Some other things to check on the AWS side:

  1. Your endpoint resolves to a public IP address (just verifies that RDS was set up with an external IP)
  2. The "Security Group" tied to your RDS instance allows port 3306 from the outside
  3. The subnet that the RDS instance is placed in has a route with an internet gateway
0
 
LVL 22

Author Closing Comment

by:Kim Walker
ID: 41883087
That was it Dave. All I had to do was ask for it the port to be opened.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41883242
You're welcome, glad to help.
0

Featured Post

How to Defend Against the WCry Ransomware Attack

On May 12, 2017, an extremely virulent ransomware variant named WCry 2.0 began to infect organizations. Within several hours, over 75,000 victims were reported in 90+ countries. Learn more from our research team about this threat & how to protect your organization!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question