node使用mysql操作数据库_MySQL
程序员文章站
2022-06-04 22:03:59
...
var mysql =require(“mysql”);
console.log(“con….“);
console.log(“con….“);
var connection=mysql.createConnection({
"host":"localhost", "port":3306, "user":"root", "password":"wjb1234", "database":"test"
});
connection.connect();
console.log(“conned…“);
var select =“select * from test “;
connection.query(select,function(err,rows){
if(err) console.log(err.message); for( var i in rows){ console.log(rows[i]); }
});
connection.end();
上一篇: php去除字符串中空字符的常用方法小结,php字符串中空小结
下一篇: C++设计模式浅识单例模式