标签:password throw nodejs str 代码 nod font span row
1、安装插件
npm install mysql
2、调用代码
var mysql = require(‘mysql‘) var connection = mysql.createConnection({ host : ‘localhost‘, user : ‘root‘, password : ‘root‘, database : ‘sm1_syxcmzb_cn‘ }) connection.connect(); connection.query(‘select * from `tp_admin_user`‘,function (error, results, fields) { if (error) throw error; console.log(‘The solution is :‘, results) }) connection.end();
标签:password throw nodejs str 代码 nod font span row
原文地址:https://www.cnblogs.com/jasonLiu2018/p/11373257.html