fjh

2.0.2 • Public • Published

准备工作

1.window系统,已经安装配置好的mysql客户端

1.修改mysql目录下的两个数据文件(mysql/create.js)(mysql/index.js)

// 以下修改的内容必须一致

// index.js文件修改一下内容
    const db = mysql.createPool({
    host: 'localhost',
    user: 'xxxx', //修改成自己的数据库用户名
    password: 'xxxxxxxxxx', //修改成自己的数据库密码
    database: 'my1', //修改成自己喜欢的数据库表的名称
    acquireTimeout: 15000,
    connectionLimit: 10, 
    waitForConnections: true, 
    queueLimit: 0,
});

// create.js文件修改一下内容
    const mysqlName = 'xxxx'; //修改成自己的数据库用户名
    const mysqlPassword = 'xxxxxxxxx' //修改成自己的数据库密码
    const mysqldatabase = 'mydata'; //修改成自己喜欢的数据库表的名称

2.创建数据库

cd mysql
node .\create.js

3.启动服务器

cd..
node .\index.js

开源协议

ISC

Readme

Keywords

Package Sidebar

Install

npm i fjh

Weekly Downloads

3

Version

2.0.2

License

ISC

Unpacked Size

18.7 kB

Total Files

11

Last publish

Collaborators

  • fengjiheng