A free administration software for the relational database PostgreSQL is pgAdmin.
Set password for the database user
It is required that the database user tom
authenticates to the PostgreSQL service with a password. If no password has been set yet, we can do it on the shell. To do this, we first open the PostgreSQL console:
__$ psql -d postgres
We set the password with \password tom
:
__# \password tom
Connect pgAdmin
On our server we have disabled remote access to the PostgreSQL database, so we connect pgAdmin via SSH.
After installation, we must first set a master password:
![](/media/dev-environment/postgresql-pgadmin-1.en.jpg?w=160)
![](/media/dev-environment/postgresql-pgadmin-2.en.jpg?w=160)
In the overview, we select "Add New Server" and create a new connection (the SSH credentials are based on the previous work of setting up a Linux web server and setting up Databases):
![](/media/dev-environment/postgresql-pgadmin-3.en.jpg?w=160)
![](/media/dev-environment/postgresql-pgadmin-4.en.jpg?w=160)
![](/media/dev-environment/postgresql-pgadmin-5.en.jpg?w=160)
![](/media/dev-environment/postgresql-pgadmin-6.en.jpg?w=160)
![](/media/dev-environment/postgresql-pgadmin-7.en.jpg?w=160)
The connection parameters are:
- General
- Name: "freely selectable" (for example server IP)
- Connection
- Hostname/address:
localhost
- Port:
5432
(PostgreSQL default port) - Maintenance database:
postgres
- Username:
tom
(database user) - Password:
*****
- Hostname/address:
- SSH Tunnel
- Use SSH tunneling:
on
- Tunnel host:
116.203.69.89
(server IP) - Tunnel port:
22123
(server port) - Username:
tom
- Authentication:
Identity file
- Identity file: "Path to private key"
- Passwort:
*****
- Use SSH tunneling:
After saving, the connection is established.
![](/media/dev-environment/postgresql-pgadmin-9.en.jpg?w=160)
All saved connections are located under "Servers". They can be started with a double click or edited and terminated via the context menu.
![](/media/dev-environment/postgresql-pgadmin-10.en.jpg?w=160)
![](/media/dev-environment/postgresql-pgadmin-1.en.jpg?w=160)