user2965514
user2965514

Reputation: 123

I am a AWS newbie and I can't connect to my DB instance

I am trying to do something ridiculously simple in PHP - connect to a DB instance. I can connect to it from my query browser using the endpoint provided but when I try to do it in the server PHP code, it throws an error of:

"Error: Unable to connect to MySQL. Debugging errno: 2003 Debugging error: Can't connect to MySQL server on 'ENDPOINT' (110) "

(I replaced my actual endpoint with the word ENDPOINT for security reasons)

I am not sure what I am doing wrong. I can point my MySQL query browser sitting on my desktop to that endpoint, provide the username/password and all is good. But as soon as I try to do it in the code with a mysqli_connect line of

$link = mysqli_connect('ENDPOINT', 'USERNAME', 'PASSWORD','innodb',3306);

it returns the can't connect error.

Can anyone help me out in plain english - how do I do a simple PHP connection to a AWS RDS DB instance?

Upvotes: 1

Views: 111

Answers (1)

RoyChehmer
RoyChehmer

Reputation: 63

Did you configure security group for the RDS instance? And did you remember to open the right port (3306) to your php server ip?

Upvotes: 2

Related Questions