GUI to view data in Google Cloud SQL

Viewed 5013

We are using a PostgreSQL database within Cloud SQL. We are using a private IP address and are accessing our database in our pods with the Cloud SQL proxy.

We are now looking for a way to quickly and easily access data in those databases. As far as I can tell there is nothing built in that supports this.

What ways are there to install a (ideally web based) GUI with which we can view our data?

3 Answers

You can install pgAdmin.

First, we need to import the repository key.

$ sudo apt-get install curl ca-certificates
$ curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

And create the /etc/apt/sources.list.d/pgdg.list file. The distributions are called codename-pgdg. In our example should be bionic-pgdg.

$ deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main

To determine the codename of your distribution you can run the lsb_release -c command.

After this, you need to update the package lists, and install the pgadmin package:

$ sudo apt-get update
$ sudo apt-get install pgadmin4

Then, you only need to run the pgadmin4 command:

$ pgadmin4

We are now accessing Google's Cloud SQL via a bastion host from our own developer machines.

I'd suggest using Data Studio. One way to do it is creating a view in the DB which collects the information to visualize the report. Then, create a data source in Data Studio and select the view that contains that information. That data source should be connected with reports/graphics.

Currently, the only possible connections to Data Studio are the following: 1. Google Cloud SQL for MySQL 2. MySQL 3. PostgreSQL

Here's a guide for you to start with the connection.

Related