Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Postgresql with Google Datastudio

I'm having troubles to connect an existing heroku database to Google Datastudio. I'm trying to add the connection and I get the following:

Access denied, please check your username and password.

Now, I'm 100% sure that I'm correct on those credentials and the problem comes from somewhere else.

I've tried with different setup, either a free or a paid PSQL instance, nothing works.

I've also setup a dummy account on elephantsql and the connection worked the first time without any issue.

Do you have any idea of the cause of that problem?

Edit:

Just found https://www.en.advertisercommunity.com/t5/Data-Studio/Heroku-Postgres-lt-gt-Google-Data-Studio/m-p/1031729 which is not helpful at the time of writing this post.

like image 343
nobe4 Avatar asked Feb 22 '17 09:02

nobe4


People also ask

Can Google Data Studio connect to PostgreSQL?

However, Google Data Studio does not only connect with Google Suite's products but also can integrate with External Data Sources or Database Management Applications like PostgreSQL, SQL, and MySQL.

Can you host PostgreSQL on Heroku?

Heroku Postgres is a managed SQL database service provided directly by Heroku. You can access a Heroku Postgres database from any language with a PostgreSQL driver, including all languages officially supported by Heroku.

Is Heroku Postgres secure?

Managed PostgreSQL from Heroku Heroku Postgres delivers the world's most advanced open source database as a trusted, secure, and scalable service that is optimized for developers.


2 Answers

Since the February 6, 2018 update, Google DataStudio allows SSL connections with PostgreSQL, which is necessary to connect to a database created via Heroku.

To enable SSL you need to provide client key+cert and server cert, which can be accomplished by taking the following steps:

  1. Generate a self-signed cert + key with openssl for client key + certificate:
openssl req \        -newkey rsa:2048 -nodes -keyout client.key \        -x509 -days 365 -out client.crt 
  1. Use the postgres_get_server_cert.py script to get the self-signed server cert from heroku psql:

https://raw.githubusercontent.com/thusoy/postgres-mitm/master/postgres_get_server_cert.py

like image 128
mfazekas Avatar answered Sep 19 '22 20:09

mfazekas


The problem is that Heroku Postgres requires an SSL connection which doesn't seem possible with Data Studio at the moment. Hopefully Google will add that option soon.

like image 30
Lee Avatar answered Sep 18 '22 20:09

Lee