Monday, January 13, 2020

[google-cloud-sql-discuss] Connection failed to the Mysql database

Error: Connection failed: php_network_getaddresses: getaddrinfo failed: Name or service not known

Code: 

<?php
$servername = "34.68.186.29";
$username = "root";
$password = "root";
$dsn = "mysql:dbname=myage;unix_socket=/cloudsql/xxxx-xx-xx-xxxxxxdac1fe3f8506:us-central1:irs"; 

// Create connection
$conn = new mysqli($dsn, $severname, $username, $password);
.
.
.
?>

app.yaml file: Refer to the screenshot

FYI:
API: App Engine Admin API Enabled




--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/121affdf-133d-413b-a276-9cb7f29e357a%40googlegroups.com.

No comments:

Post a Comment