首先是连接语句:
var mysql = require('mysql');
var connection = mysql.createConnection({
host:'localhost',
user:'root',
password:'123456',
port:'3306',
database:'registerdb'
});
connection.connect((err)=>{
if(err){
throw err;
}
console.log('连接成功');
});
//中间编写查插删改语句
1