Solved

PHP connection to remote AWS MySQL RDS

Posted on 2016-11-10
4
93 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
  • 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 13

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Let’s list some of the technologies that enable smooth teleworking. 
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 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