Connection failed to the Mysql database

23 views
Skip to first unread message

Ajit sahoo

unread,
Jan 13, 2020, 1:04:13 PM1/13/20
to Google Cloud SQL discuss
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




Screenshot (5).png

Amit Sinha

unread,
Jan 15, 2020, 7:23:26 PM1/15/20
to Google Cloud SQL discuss

Hello Ajit, 


Thank you for using the Google Group.


Did you follow any documentation to connect with the database? This might need to investigate further to find the issue here. So I would recommend opening a private issue in the issue tracker and providing more information regarding the issue such as the steps that you followed including the project ID and database name that you are trying to connect so we can investigate further. 


Reply all
Reply to author
Forward
0 new messages