Skip to content

lihao336991/node-express-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node.js环境下express+mysql的服务端项目示例

进入项目根目录

npm install

进入/config/mysql.js,配置数据库设置

mysql = {

        host: "xx.xxx.xxx.xxx", //这是数据库的地址

        user: "xxx", //需要用户的名字

        password: "xxx", //用户密码 ,如果你没有密码,直接双引号就是

        database: "xxx" //数据库名字

    } //好了,这样我们就能连接数据库了



module.exports = mysql; //用module.exports暴露出这个接口,

运行项目

npm start

About

node.js环境下express+mysql的服务端项目示例

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages