This guide provides instructions on how to connect to the PostgreSQL database using pgAdmin.
- Host name/address:
db(This is the service name defined indocker-compose.yml) - Port:
5432 - Maintenance database:
postgres - Username:
postgres - Password:
password
- Open your web browser and go to
http://localhost:5050. This is where pgAdmin is running. - Log in to pgAdmin using the default credentials:
- Email:
admin@admin.com - Password:
admin
- Email:
- Once logged in, in the left sidebar, right-click on "Servers" and select "Create" > "Server...".
- In the "Create - Server" dialog:
- Go to the "General" tab:
- Name: Give your connection a name, e.g.,
RustMicro DB.
- Name: Give your connection a name, e.g.,
- Go to the "Connection" tab:
- Host name/address: Enter
db. - Port: Enter
5432. - Maintenance database: Enter
postgres. - Username: Enter
postgres. - Password: Enter
password. - Check the box "Save password?" if you want pgAdmin to remember the password.
- Host name/address: Enter
- Click the "Save" button.
- Go to the "General" tab:
- You should now see the database server in the left sidebar. Click on it to expand and see the databases.
-
If you cannot connect, make sure all Docker containers are running:
docker-compose ps
You should see
rustmicro_db,rustmicro_pgadmin, andrustmicro_appall in the "Up" state. -
If you're on Windows or macOS and
dbhostname doesn't work, you can try using the IP address of the database container. Find the IP address by running:docker inspect rustmicro_db | grep IPAddressThen use that IP address in the "Host name/address" field instead of
db.