I created a database on Google Cloud platform to remove data storage from my server to google to allow moving of the application ext, I created an older version of data and created a PDO connection file in PHP to connect, but it will not.
This issue is related to Google Cloud Storage, not Local mySQL server.
PHP Error : Connection failed: SQLSTATE[HY000] [1045] Access denied for user 'allfree'@'72.XX.33.XX' (using password: YES)
Using simple root / simple pass to test as SQL user / pass also fails
Google instance name : afc-storage:us-west1:afc
Google Error log : 2019-05-13 14:50:55.200 EDT
2019-05-13T18:50:55.199830Z 101583 [Note] Access denied for user 'allfree'@'72.XX.33.XX' (using password: YES)
Here is my connection code:
$dbhost = "34.83.119.218";
$dbuser = "allfree";
$dbpasswd = "XXXX";
$db_name= "allfreec_afc";
$dsn = 'mysql:dbname='.$db_name.';host='.$dbhost;
try {
$dbo = new PDO($dsn ,$dbuser, $dbpasswd);
$dbo->exec("set names utf8");
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}
I am only using the database name "allfreec_afc", the instance is not required in the connection from what I keep reading over and over again.