Commit 0745644c authored by 尚斌杰's avatar 尚斌杰

增加mysql数据库链接

parent 140670d8
......@@ -20,6 +20,19 @@ module.exports = appInfo => {
},
};
config.sequelize = {
dialect: 'mysql', // support: mysql, mariadb, postgres, mssql
dialectOptions: {
charset: 'utf8mb4',
},
database: 'egg-sequelize-example-dev',
host: 'localhost',
port: '3306',
username: 'root',
password: 'shang4148',
timezone: '+08:00',
};
config.api = 'https://club.m.autohome.com.cn';
return config;
......
......@@ -6,3 +6,8 @@ exports.ejs = {
enable: true,
package: 'egg-view-ejs',
};
// exports.sequelize = {
// enable: true,
// package: 'egg-sequelize',
// };
......@@ -6,8 +6,10 @@
"dependencies": {
"egg": "^2.2.1",
"egg-scripts": "^2.5.0",
"egg-sequelize": "4.1.0",
"egg-view-ejs": "^2.0.0",
"moment": "^2.22.2"
"moment": "^2.22.2",
"mysql2": "1.6.1"
},
"devDependencies": {
"autod": "^3.0.1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment