创建并连接数据库,并修改登录和注册接口

This commit is contained in:
2026-08-30 18:14:49 +08:00
parent 4d11a1237f
commit 51c41e8fb7
331 changed files with 90228 additions and 16 deletions
+20
View File
@@ -0,0 +1,20 @@
const mysql = require('mysql2')
const connection = mysql.createConnection({
host: 'localhost',
port: 3306,
user: 'root',
password: '960707Shf_',
database: 'chat_mysql'
})
connection.connect((error) => {
if (error) {
console.error('MySQL 连接失败:', error)
return
}
console.log('MySQL 连接成功!')
})
module.exports = connection