3
votes

I am running GAE/python application (App Engine Standard Edition) in same project as (2nd Gen) CloudSQL, in same Region as well.

However I continue to get following error

OperationalError: (1045, "Access denied for user 'root'@'cloudsqlproxy~xx.xxx.xx.xx' (using password: NO)")

The apps automatically get authorized, so can't figure out the issue. Also shouldn't the connection be from root@localhost instead of cloudsqlproxy? Do I need to create a 'root'@'cloudsqlproxy user?

1

1 Answers

3
votes

If you set a root password for your instance, you will need to specify that password when connecting.

First Generation instances come out of the box with a root user with an empty password, but Second Generation instances do not. For a Second Generation instance, you should set the root password and use that in your app.

This could be clarified in our documentation. Not creating a root user with an empty password avoids the issue of opening the database wide open in case the network ACLs are misconfigured.