Wednesday, January 15, 2020

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

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. 



On Monday, January 13, 2020 at 1:04:13 PM UTC-5, ajit sahoo wrote:
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/c9b78818-3579-4583-b103-6b1260c27b2b%40googlegroups.com.

No comments:

Post a Comment