60 lines
1.2 KiB
Markdown
60 lines
1.2 KiB
Markdown
|
|
# Fix Database Connection First
|
||
|
|
|
||
|
|
## Current Issue
|
||
|
|
|
||
|
|
The deployment script is failing because the database user or database doesn't exist.
|
||
|
|
|
||
|
|
## Quick Fix
|
||
|
|
|
||
|
|
Run this command to set up the database:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
cd ~/projects/proxmox/explorer-monorepo
|
||
|
|
sudo bash scripts/setup-database.sh
|
||
|
|
```
|
||
|
|
|
||
|
|
## What This Does
|
||
|
|
|
||
|
|
1. Creates `explorer` user with password `L@ker$2010`
|
||
|
|
2. Creates `explorer` database
|
||
|
|
3. Grants all necessary privileges
|
||
|
|
4. Tests the connection
|
||
|
|
|
||
|
|
## Then Run Deployment
|
||
|
|
|
||
|
|
After database setup, run:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
bash EXECUTE_DEPLOYMENT.sh
|
||
|
|
```
|
||
|
|
|
||
|
|
## Alternative: Check What Exists
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Check if PostgreSQL is running
|
||
|
|
systemctl status postgresql
|
||
|
|
|
||
|
|
# Check if user exists
|
||
|
|
sudo -u postgres psql -c "\du" | grep explorer
|
||
|
|
|
||
|
|
# Check if database exists
|
||
|
|
sudo -u postgres psql -c "\l" | grep explorer
|
||
|
|
```
|
||
|
|
|
||
|
|
## Manual Setup (if script doesn't work)
|
||
|
|
|
||
|
|
```bash
|
||
|
|
sudo -u postgres psql << EOF
|
||
|
|
CREATE USER explorer WITH PASSWORD 'L@ker\$2010';
|
||
|
|
CREATE DATABASE explorer OWNER explorer;
|
||
|
|
GRANT ALL PRIVILEGES ON DATABASE explorer TO explorer;
|
||
|
|
\q
|
||
|
|
EOF
|
||
|
|
|
||
|
|
# Test
|
||
|
|
PGPASSWORD='L@ker$2010' psql -h localhost -U explorer -d explorer -c "SELECT 1;"
|
||
|
|
```
|
||
|
|
|
||
|
|
**Run `sudo bash scripts/setup-database.sh` first, then `bash EXECUTE_DEPLOYMENT.sh`**
|
||
|
|
|