更新 server/config/database.js

This commit is contained in:
ywp
2025-10-23 09:45:42 +08:00
parent 57168070f6
commit 3f4b03dbf5

View File

@ -24,15 +24,12 @@ const pool = mysql.createPool({
// 测试数据库连接
async function testConnection() {
try {
const connection = await pool.getConnection();
console.log('数据库连接成功');
connection.release();
return true;
} catch (error) {
console.error('数据库连接失败:', error.message);
return false;
}
}
// 执行查询