0

I have a ubuntu 20 on dreamcompute (which is cloud computing).

I create a user and a database. Here is the list of database and users (for some reason, I can't see database under a matt username).

I went into: nano /etc/postgresql/13/main/postgresql.conf & nano /etc/postgresql/13/main/pg_hba.conf and did the whole '*' and '0.0.0.0/0'

postgres=# \l
                              List of databases
   Name    |  Owner   | Encoding | Collate |  Ctype  |   Access privileges
-----------+----------+----------+---------+---------+-----------------------
 postgres  | postgres | UTF8     | C.UTF-8 | C.UTF-8 |
 strapi    | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =Tc/postgres         +
           |          |          |         |         | postgres=CTc/postgres+
           |          |          |         |         | hossein=CTc/postgres
 template0 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
           |          |          |         |         | postgres=CTc/postgres
 template1 | postgres | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
           |          |          |         |         | postgres=CTc/postgres
(4 rows)

as you can see you can't see Superuser and database strapi under the matt username.

                                   List of roles
 Role name |                         Attributes                         | Member of
-----------+------------------------------------------------------------+-----------
 matt      |                                                            | {}
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
 ubuntu    |                                                            | {}

I'm using my dream compute's ip address as my host and use my database and user and password but get error message: connection attempt time out.

enter image description here

Could someone please give me a pointer on why this is happening? I have been working onthis for 2 weeks now and I can't get it to work.

2
  • Have you tried ALTER ROLE matt WITH LOGIN;? Commented Mar 13, 2021 at 0:39
  • @richyen I'm new to this but that changes it to matt being the default login account? Commented Mar 13, 2021 at 17:36

2 Answers 2

1

Error message is connection time out. That usually means that the port is blocked by a firewall. Check your cloud provider firewall settings and iptablesin your Linux box in case you have installed it.

If there was problem with permissions, the error message would be something else.

Sign up to request clarification or add additional context in comments.

Comments

0

as ex4 mentioned above I needed to reachout to the company that I was renting my cloud computer from but I still could not connect to the database.

The way I went around it is that you can ssh into your database and then connect to your database as a localhost since you are ssh into your cloud computer.

In DBeaver you have a ssh tab and you can connect and then you got back to your postgres tab and fill the localhost, user, database name, and user password area and simply click connect.

Sadly this took weeks to come to this :/

1 Comment

You could do simple SSH tunneling like `ssh -L 5432:localhost:5432'. But SSH tunneling isn't really a solution for your problem, if you want to go production with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.