Files
explorer-monorepo/FIX_DATABASE_FIRST.md

1.2 KiB

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:

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 EXECUTE_DEPLOYMENT.sh

Alternative: Check What Exists

# 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)

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