发布网友 发布时间:2022-04-22 01:37
共1个回答
热心网友 时间:2022-04-07 23:59
先npm install mysql
然后代码中就可以require('mysql');
就可以使用了
var mysql = require('mysql');var pool = mysql.createPool(config);pool.getConnection(function(err, connection) {
// Use the connection
connection.query( 'SELECT something FROM sometable', function(err, rows) {
// And done with the connection.
connection.end();
// Don't use the connection here, it has been returned to the pool.
});});
js代码透明,你在写好代码提交给别人的时候,或是部署的时候,用Jshaman给代码加密一下,别人就看不了你的代码了