Home > Blockchain >  MySQL connect to AWS - RDS
MySQL connect to AWS - RDS

Time:10-12

I have one database in Aws (This first time I working with Aws) I can connect to my database with "MySQL workbench" before not worked but I changed RDS settings for inbound IP address

Now I want connect to my database with PHP by Xampp I useing mysqli

This my table picture: enter link description here

My database info:

dbname = 'aws-main-db'
user = 'admin'
pass = 'Tfrfgd66#'
table_name= 'my_table2'
dbport = '3306'

This my error:

Warning: mysqli::__construct(): (HY000/1049): Unknown database 'aws-main-db' in C:\xampp\htdocs\My\Add record to ASW RDS Database\lib\class-database.php on line 16

CodePudding user response:

although i do not know the name of the server, this may simply be because your aws database is named differently from the one you put into the code. Other than that this is all i can think off with the current information provided.

CodePudding user response:

This example: Host name is true because I can connect with "MySQL workbench"

$myconn = new mysqli('xxxxxxx.amazonaws.com', 'admin', 'Tfrfgd66#', 'aws-main-db', '3306');
  • Related