satitm-sso-node/config/database.js
2024-05-05 16:59:26 +07:00

23 lines
503 B
JavaScript

const mysql = require('mysql2');
// Create a connection pool
const database = mysql.createPool({
host: '192.168.0.236',
user: 'cudnodejs',
password: 'iDvuHQsPXF5AasESydypgu',
database: 'cudnodejs',
connectionLimit: 10
});
database.getConnection((err, connection) => {
if(err) {
console.error('Error connecting to the database:', err);
} else {
console.log('Connected to the database');
connection.release();
}
});
// Export the connection pool
module.exports = database;