1
0

Add database connection info to README

This commit is contained in:
Dennis Reimann
2021-03-06 20:10:12 +01:00
parent d5d6a6a7da
commit 27c4471181

View File

@@ -511,3 +511,30 @@ This option does not need to stop and restart the docker-containers:
cd "$BTCPAY_BASE_DIRECTORY/btcpayserver-docker"
./backup.sh --only-db
```
## How can I connect to the database?
On the server you can open a database session by connecting via `psql` as the postgres user:
```bash
docker exec -ti $(docker ps -a -q -f "name=postgres_1") psql -U postgres
```
Then, inside `psql` you can select a database and interact with the tables:
```bash
# list databases
\l
# connect to database
\c btcpayservermainnet
# list tables
\dt+
# list users
SELECT "Id", "Email" FROM "AspNetUsers";
# end session
\q
```