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!
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.
Comments