const mysql = require("mysql");
const connection = mysql.createConnection({
host: "localhost",
user: "root",
password: "123456",
database: "town_now",
})
connection.connect((err) => {
if (err) {
console.log("数据库连接失败")
} else {
console.log("数据库连接成功");
}
})