const { Sequelize } = require('sequelize'); // Common PostgreSQL passwords to try const passwords = ['password', 'admin', 'postgres', 'root', '123456', '']; async function testConnection(password) { const sequelize = new Sequelize('postgres', 'postgres', password, { host: 'localhost', port: 5432, dialect: 'postgres', logging: false }); try { await sequelize.authenticate(); console.log(`āœ… SUCCESS with password: "${password}"`); await sequelize.close(); return password; } catch (error) { console.log(`āŒ Failed with password: "${password}" - ${error.message}`); await sequelize.close(); return null; } } async function main() { console.log('šŸ” Testing PostgreSQL connection with common passwords...\n'); for (const password of passwords) { const result = await testConnection(password); if (result) { console.log(`\nšŸŽ‰ Found working password: "${result}"`); console.log('šŸ’” Update your .env file with this password:'); console.log(` DB_PASSWORD=${result}`); console.log(` DATABASE_URL=postgresql://postgres:${result}@localhost:5432/luckychit`); return; } } console.log('\nāŒ No working password found.'); console.log('šŸ’” Please check:'); console.log(' 1. Is PostgreSQL running?'); console.log(' 2. What is the password for user "postgres"?'); console.log(' 3. Try connecting manually with: psql -U postgres'); } main().catch(console.error);