Having difficulties connecting to Amazon RDS MySql server with PHP

user2836292

I'm just trying a basic connection with a PHP script and running into some issues, my PHP code is simply:

$host="endpoint:3306"; // Host name 
$username="user"; // Mysql username 
$password="pw"; // Mysql password 
$db_name="RawData"; // Database name 

$conn = new mysqli($host, $username, $password, $db_name, 3306);

//Check connection
if($conn->connect_errno > 0){
    die('Unable to connect to database [' . $conn->connect_error . ']');
}

And getting an error Access denied for user 'user'@'cpe-174-109-76-241.nc.res.rr.com.' If it is to the point that is is an Access Denied error, is that based on the password? My password works because I can connect to the instance with MySQL Workbench on this same machine. Do I need to make an update to my security group for the PHP code to connect through localhost? Let me know if there is any more information I need to provide, I'm very new to PHP and very lost with this basic setup. Thanks!

Drew

You may have a security group preventing access.

Examine the allowable IP addr , adding yours as a test. Consider adding 0.0.0.0 and CIDR in the security group at play with port 3306

http://whatismyipaddress.com if needed

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Connecting MySQL workbench to Amazon RDS instance

From Dev

MySQL difficulties with AS combined with HAVING

From Dev

Blocked on connecting to Amazon RDS

From Dev

Connecting to an Amazon RDS with Express

From Dev

Amazon RDS to Custom MySQL Server InnoDB Key Size

From Dev

Amazon RDS to Custom MySQL Server InnoDB Key Size

From Dev

Having difficulties with pg_query(); in php

From Dev

Connecting to Amazon RDS instance through EC2 instance using MySQL Workbench

From Dev

Connecting App To an Amazon Aurora RDS Instance

From Dev

Connecting to an Amazon RDS instance via Heroku

From Dev

Amazon RDS SQL Server: how to detect if it is RDS?

From Dev

MySQL and Amazon RDS DBA user

From Dev

MySQL/Amazon RDS error on import

From Dev

MySQL/Amazon RDS error on import

From Dev

Amazon RDS MySQL tmpdir location

From Dev

MySQL query not working on Amazon RDS?

From Dev

Amazon RDS timeout with php pdf

From Dev

Connecting AWS RDS(mysql) from spefic ip in php:timed out error

From Dev

Having difficulties parsing dirty html code with PHP DOMDocument

From Dev

Connecting EC2 to RDS via php

From Dev

Timeouts connecting to a Postgres database on Amazon RDS from Azure

From Dev

connecting amazon redshift server from tableau server

From Dev

Problems in connecting to Mysql server

From Dev

Trouble Connecting to the MySQL server

From Dev

Problems in connecting to Mysql server

From Dev

PHP PDO Hide Error message when failed connecting to MySQL server

From Dev

Connection refused for connecting with MySQL server using php in XAMPP(MacOS)

From Dev

Trouble connecting to mysql using php5 LAMP server

From Dev

connecting php to mysql

Related Related

HotTag

Archive