Heroku Mongohq nodejs将无法连接

时间:2013-11-25 03:10:23

标签: node.js heroku mongohq

我已经尝试了一切来连接 - 我替换了真实的用户名和密码而不是MONGOLAB_URI而且没有用,我已经尝试了下面的内容但它仍然无法连接

var http = require ('http'); 
var mongoose = require('mongoose');


var uristring =
process.env.MONGOLAB_URI ||
process.env.MONGOHQ_URL ||
'mongodb://localhost/clioflict';


// Makes connection asynchronously.  Mongoose will queue up database
// operations and release them when the connection is complete.

mongoose.connect(uristring, function (err, res) {
  if (err) {
  console.log ('ERROR connecting to: ' + uristring + '. ' + err);
  } else {
  console.log ('Succeeded connected to: ' + uristring);
  }
});

这是错误消息:

错误:连接到数据库时出错 2013-11-25T02:04:02.076149 + 00:00 app [web.1]:抛出新错误('连接数据库错误<'+ err +'>');

任何建议?

0 个答案:

没有答案