DSN is:
mysql:dbname='MyDB';unix_socket='/cloudsql/ethereal-accord-123456789:us-central1:dev-Instance'
Connection failed: SQLSTATE[HY000] [2002] No such file or directory
PDO Connection Code:
try {
$conn = new PDO($dsn, $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
return $conn;
} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage().' <BR>';
}
I Cannot seem to find detail information on how to setup the connections correctly. I follow all documents and activated the permissions for the VM IP, the Client SQL API, and Admin API, and nothing..
Any Help will be appreciated.