const mysql = require('mysql2');

const db = mysql.createConnection({
   host: 'srv876.hstgr.io',
    user: 'u979810802_gurpreet',
    password: 'Admin@123#2025',
    database: 'u979810802_next_growth',
    connectTimeout: 10000 // 10 seconds
});

db.connect(err => {
  if (err) {
    console.error('❌ DB connection failed:', err.message);
    return;
  }
  console.log('✅ Connected to remote MySQL!');
});

module.exports = db;
