const mysql = require('mysql2');
const config = require('../config/config');

const connection = mysql.createConnection(config.db);

connection.connect(err => {
  if (err) {
    console.error('MySQL connection error:', err);
    return;
  }
  console.log('Connected to MySQL database');
});

module.exports = connection;
