Closed SohaibShafiq1 closed 3 years ago
It looks like you are running the proxy on 127.0.0.1:5431
- the default postgres port is actually 5432
.
You need to tell your app you want to connect on 127.0.0.1:5432
when running locally, and on /cloudsql/<INSTANCE_CONNECTION_NAME>
when deployed.
If you're still having issues when deployed it's useful to check the following:
project:region:instance
)You can also take a look at this documentation, which provides detailed instructions on how to connect: https://cloud.google.com/sql/docs/mysql/connect-app-engine-flexible
@kurtisvg But when i run the proxy on port 5432 i got some error like: "listen tcp 127.0.0.1:5432: bind: An attempt was made to access a socket in a way forbidden by its access permissions."
Is the server running locally and accepting connections on Unix domain socket "/cloudsql/connection-name/.s.PGSQL.5431"? Whenever i deploy and login for superuser, i recieve this error. My app.yaml:
My Settings.py:
I Run cloud_sql_proxy.exe file as well on port 5431.
cloud_sql_proxy.exe -instances="<connection-name>"=tcp:5431
Deployment is successful but database connection is a problem. What is the solution for that.