1 Star 0 Fork 1

穆成丰 / nodejs操作mysql

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mysql.js 703 Bytes
一键复制 编辑 原始数据 按行查看 历史
mannymu 提交于 2017-07-17 08:48 . tijiao
//连接数据库
var mysql = require('mysql');
var connection = mysql.createConnection({
host: 'bdm253137448.my3w.com', //数据库地址
user: 'bdm253137448', //数据库用户名
password: 'muchengfeng123', //数据库管理密码
database:'bdm253137448_db', //数据库名称
insecureAuth: true
});
connection.connect();
//查询
connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
if (err) throw err;
console.log('The solution is: ', rows);
});
//关闭连接
connection.end ();
JavaScript
1
https://gitee.com/muand/nodejsCaoZuomysql.git
git@gitee.com:muand/nodejsCaoZuomysql.git
muand
nodejsCaoZuomysql
nodejs操作mysql
master

搜索帮助