egg icon indicating copy to clipboard operation
egg copied to clipboard

阿里云ecs 部署程序,启动程序,报连接不上数据库错误

Open luyaohua2011 opened this issue 5 years ago • 2 comments

##本地连接服务器上的数据库可以正常启动项目访问

[email protected] debug E:\房e安\node\origin-cms egg-bin debug

Debugger attached. Debugger attached. Debugger attached. Waiting for the debugger to disconnect... [egg-ts-helper] create typings\app\controller\index.d.ts (10ms) [egg-ts-helper] create typings\app\model\index.d.ts (14ms) [egg-ts-helper] create typings\config\index.d.ts (50ms) [egg-ts-helper] create typings\config\plugin.d.ts (13ms) [egg-ts-helper] create typings\app\service\index.d.ts (15ms) [egg-ts-helper] create typings\app\index.d.ts (3ms) 2020-12-27 09:38:30,551 INFO 17396 [master] node version v14.15.0 2020-12-27 09:38:30,554 INFO 17396 [master] egg version 2.29.1 Debugger attached. (node:10368) [SEQUELIZE0006] DeprecationWarning: This database engine version is not supported, please update your database server. More information https://github.com/sequelize/sequelize/blob/master/ENGINE.md (Use node --trace-deprecation ... to show where the warning was created) 2020-12-27 09:38:36,440 INFO 10368 egg-sequelize Executed (default): SELECT 1+1 AS result 2020-12-27 09:38:36,450 INFO 17396 [master] agent_worker#1:10368 started (5883ms) Debugger attached. 9230 opened Debug Proxy online, now you could attach to 9999 without worry about reload. DevTools → chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9999/ws_proxy (node:14980) [SEQUELIZE0006] DeprecationWarning: This database engine version is not supported, please update your database server. More information https://github.com/sequelize/sequelize/blob/master/ENGINE.md (Use node --trace-deprecation ... to show where the warning was created) 2020-12-27 09:38:42,838 INFO 14980 egg-sequelize Executed (default): SELECT 1+1 AS result 2020-12-27 09:38:42,892 INFO 17396 [master] ### egg started on http://127.0.0.1:7001 (12337ms) ##部署到阿里云ecs 启动项目报错 [root@iZwz9hne8994mz6kht96fgZ origin-cms]# npm start

[email protected] start /www/wwwroot/origin-cms egg-scripts start --daemon --title=egg-server-origin-cms

[egg-scripts] Starting egg application at /www/wwwroot/origin-cms [egg-scripts] Run node /www/wwwroot/origin-cms/node_modules/egg-scripts/lib/start-cluster {"title":"egg-server-origin-cms","baseDir":"/www/wwwroot/origin-cms","framework":"/www/wwwroot/origin-cms/node_modules/egg"} --title=egg-server-origin-cms [egg-scripts] Save log file to /root/logs [egg-scripts] Wait Start: 1... [egg-scripts] tail -n 100 /root/logs/master-stderr.log [egg-scripts] Got error when startup: [egg-scripts] (node:11261) [SEQUELIZE0006] DeprecationWarning: This database engine version is not supported, please update your database server. More information https://github.com/sequelize/sequelize/blob/master/ENGINE.md [egg-scripts] (Use node --trace-deprecation ... to show where the warning was created) [egg-scripts] [egg-scripts] Start got error, see /root/logs/master-stderr.log [egg-scripts] Or use --ignore-stderr to ignore stderr at startup. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: egg-scripts start --daemon --title=egg-server-origin-cms npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-12-27T01_34_04_982Z-debug.log [root@iZwz9hne8994mz6kht96fgZ origin-cms]#

##数据库配置文件 config.sequelize = { dialect: 'mysql', host: '', port: 3506, database: '', username: '', password: '', define: { underscored: true } }

luyaohua2011 avatar Dec 27 '20 01:12 luyaohua2011

DeprecationWarning: This database engine version is not supported, please update your database server. More information https://github.com/sequelize/sequelize/blob/master/ENGINE.md

看上边的信息, 是不是版本不匹配了?

我的项目是 OK 的

  • ECS MySQL 版本: 8.0
  • egg 版本: 2.15.1
  • egg-sequelize 版本: 5.2.1

rmlzy avatar Dec 29 '20 01:12 rmlzy

egg-seuelize的数据库引擎支持的mysql最低版本是5.7

hsbtr avatar Jan 20 '21 03:01 hsbtr