Friday, August 3, 2018

[google-cloud-sql-discuss] Unable to connect cloud SQL postgres

Any help should appreciated,
I have been trying to connect prostgres DB instanc using python3.5 , Flask using
sqlalchemy,

Used below line to connect:
engine = create_engine('postgresql+psycopg2://<user I'd>:<password>@/<database name>?host=/cloudsql/<projectid>:us-central1:<database name>=tcp:5432')


Below the error I am getting.

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/cloudsql/<project I'd>:us-central1:<database name>=tcp:5432/.s.PGSQL.5432"?
(Background on this error at: http://sqlalche.me/e/e3q8)

--
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/2dc70d70-8d8e-417c-8293-0c6b6d317509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment