1
votes

I know the general syntax for making a connection to Google Cloud SQL from App Engine using PHP to be:

$conn = new mysqli(null, "root", "", "dbname", null, 
"/cloudsql/connectionname");

The username and password however, I am unsure of. I have tried using my instance username and password here, as well as my gmail username and password. Root does not seem to be working. Is there a way to find out what these are? I have read that root is default, but I guess I don't understand.

The only other reason I can see that my connection is not working (getting a NoConnect() error) is that my yaml file could be written wrong. Currently, I have:

runtime: php55
api_version: 1

handlers:
- url: /
script: app.php

Do I need to include MySQL username and password here?

Thanks for any help.

1

1 Answers

4
votes

I ended up figuring this out. I used "root" as the username and my instance password as the "password". Before I was trying my instance name and then the instance password.