-1

i try to connect to my amazon RDS server in my home pc but i cant to do that i get a error: this is my code:

$mysqli = new mysqli('server.eu-west-1.rds.amazonaws.com:3306', 'serverName', 'serverPassword', 'serverTable'); $mysqli->set_charset('utf8'); var_dump($mysqli);

but i get an error:

enter image description here

in my SecurityGroup at amazon:

enter image description here

Your Common Sense
  • 152,517
  • 33
  • 193
  • 313
haisom
  • 105
  • 1
  • 1
  • 7

2 Answers2

0

There are multiple reasons which could lead to this issue. Few of them are

  • Placing RDS instance in private subnet
  • Security group restrictions
  • NACL restrictions

In your case, its most likely you have attached a security group to amazon RDS instance which is not accessible from outside. Also make sure you have enabled public access to your database instance in RDS.

Ashan
  • 15,582
  • 2
  • 32
  • 54
0

i fix that

looks at DB Instances in RDS: dont forget to do yes for Publicly Accessible :)

enter image description here

haisom
  • 105
  • 1
  • 1
  • 7