48 lines
1.1 KiB
Markdown
48 lines
1.1 KiB
Markdown
# Quick Fix: Database Connection
|
|
|
|
## The Issue
|
|
|
|
You tried to connect with `blockscout` user, but the **custom explorer backend** uses the `explorer` user.
|
|
|
|
## Correct Command
|
|
|
|
```bash
|
|
# ✅ Correct - for custom explorer backend
|
|
PGPASSWORD='L@ker$2010' psql -h localhost -U explorer -d explorer -c "SELECT 1;"
|
|
```
|
|
|
|
## Quick Steps
|
|
|
|
1. **Test connection:**
|
|
```bash
|
|
PGPASSWORD='L@ker$2010' psql -h localhost -U explorer -d explorer -c "SELECT 1;"
|
|
```
|
|
|
|
2. **Run migration:**
|
|
```bash
|
|
cd explorer-monorepo
|
|
PGPASSWORD='L@ker$2010' psql -h localhost -U explorer -d explorer \
|
|
-f backend/database/migrations/0010_track_schema.up.sql
|
|
```
|
|
|
|
3. **Restart server:**
|
|
```bash
|
|
pkill -f api-server
|
|
cd explorer-monorepo/backend
|
|
export DB_PASSWORD='L@ker$2010'
|
|
./bin/api-server
|
|
```
|
|
|
|
4. **Verify:**
|
|
```bash
|
|
curl http://localhost:8080/health
|
|
```
|
|
|
|
## Two Separate Systems
|
|
|
|
- **Blockscout:** User `blockscout`, Password `blockscout`, DB `blockscout`
|
|
- **Custom Explorer:** User `explorer`, Password `L@ker$2010`, DB `explorer`
|
|
|
|
See `docs/DATABASE_CONNECTION_GUIDE.md` for full details.
|
|
|