2018-11-13 15:20:53 +00:00
|
|
|
1. Install the postgresql server and configure it.
|
|
|
|
If you already have a postgresql instance you can skip this step.
|
|
|
|
|
|
|
|
First, we have to install the postgresql server with:
|
|
|
|
|
2024-02-09 06:41:39 +00:00
|
|
|
sudo zypper in postgresql-server
|
2018-11-13 15:20:53 +00:00
|
|
|
|
|
|
|
Then we start the server:
|
|
|
|
|
2024-02-09 06:41:39 +00:00
|
|
|
sudo systemctl start postgresql
|
2018-11-13 15:20:53 +00:00
|
|
|
|
|
|
|
And then we have to add login credentials for the user postgres with:
|
|
|
|
|
|
|
|
sudo -u postgres psql postgres
|
|
|
|
|
|
|
|
This will open the psql client where you have to type:
|
|
|
|
|
|
|
|
\password postgres
|
|
|
|
|
|
|
|
It will ask for the password and then once again to confirm it. You can exit psql by typing '\q'
|
|
|
|
|
|
|
|
Now we'll make sure postgresql allows users to login by asking for the
|
|
|
|
password. Edit the /var/lib/pgsql/data/pg_hba.conf file as root and replace
|
|
|
|
the "ident" authentication method by "md5", like this:
|
|
|
|
|
|
|
|
host all all 127.0.0.1/32 md5
|
|
|
|
host all all ::1/128 md5
|
|
|
|
|
|
|
|
Of course, if users need to log in from other hosts, use the proper network masks.
|
|
|
|
|
|
|
|
Now, let's restart the server so the new configuration is used:
|
|
|
|
|
2024-02-09 06:41:39 +00:00
|
|
|
sudo systemctl restart postgresql
|
2018-11-13 15:20:53 +00:00
|
|
|
|
|
|
|
2. Start pgAdmin4 ("Management tool for PostgreSQL (pgAdmin 4)") which you can
|
|
|
|
find in the Office menu in your desktop. This will open pgadmin4 in your
|
|
|
|
default browser and an icon in your system tray which can be used to open
|
|
|
|
more windows or shut pgadmin down.
|
|
|
|
|
|
|
|
3. In pgAdmin, click on "Add New Server" . Set a name for the server connection,
|
|
|
|
go to the "Connection" tab and set the connection information . If you're
|
|
|
|
using a postgresql instance in the same host, you can use:
|
|
|
|
Hostname: localhost
|
|
|
|
Password: the password of the postgres user.
|
|
|
|
|
|
|
|
Click on "Save" to store the new server configuration.
|
|
|
|
|
|
|
|
4. The server should appear in the left pane.
|
2024-02-09 06:41:39 +00:00
|
|
|
|
|
|
|
5. Note that if you want pgadmin4 to support cloud deployment, you need to install the
|
|
|
|
pgadmin4-cloud package
|