一直试着让我的风帆应用程序在heroku上升。目前正在运行
`web: sails lift --silly`
来自Procfile的。
我的production.js文件看起来像这样
`connections: {
subzapp_db: {
adapter: 'sails-mysql',
host: process.env.CLEARDB_DATABASE_URL,
user: process.env.CLEARDB_USER,
password: process.env.JAWSDB_PASS,
database: process.env.CLEARDB_NAME
}
},
和我的models.js
module.exports.models = {
migrate: 'drop',
connection: 'subzapp_db'
};
`slug compilation finished
Dec 08 17:33:54 subzapp heroku/web.1: State changed from crashed to starting
Dec 08 17:34:09 subzapp heroku/web.1: Starting process with command `sails lift --silly`
Dec 08 17:34:11 subzapp app/web.1: Starting app...
Dec 08 17:34:12 subzapp app/web.1: Setting Node environment...
Dec 08 17:34:12 subzapp app/web.1: Loading app config...
Dec 08 17:34:12 subzapp app/web.1: Exposing global variables... (you can disable this by modifying the properties in `sails.config.globals`)
Dec 08 17:34:12 subzapp app/web.1: events.js:141
Dec 08 17:34:12 subzapp app/web.1: throw er; // Unhandled 'error' event
Dec 08 17:34:12 subzapp app/web.1: ^
Dec 08 17:34:12 subzapp app/web.1: Error: connect ECONNREFUSED 67.214.212.101:12345
Dec 08 17:34:12 subzapp app/web.1: at Object.exports._errnoException (util.js:837:11)
Dec 08 17:34:12 subzapp app/web.1: at exports._exceptionWithHostPort (util.js:860:20)
Dec 08 17:34:12 subzapp app/web.1: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
` 我正在使用Cleardb mysql附加组件。我只用数据库url和其他一百万个东西尝试了生产js文件。真的卡住了。我也尝试用相同的错误更改为jawsdb。 这在我的本地机器上工作正常。 任何帮助非常感谢。
答案 0 :(得分:0)
ECONNREFUSED表示您的数据库访问失败。可能是错误的用户/密码,错误的数据库名称或地址。仔细检查这些值!