多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
修改适配器的配置,增加mysql的配置节 文件路径:/src/config/adapter.js ~~~ const mysql = require("think-model-mysql"); /** * model adapter config * @type {Object} */ exports.model = { type: "mysql", common: { logConnect: isDev, logSql: isDev, logger: (msg) => think.logger.info(msg), }, mysql: { handle: mysql, database: "learning", prefix: "think_", encoding: "utf8", host: "127.0.0.1", port: "3306", user: "root", password: "123456", dateStrings: true, }, }; ~~~