作者:鱼db在海 | 来源:互联网 | 2023-05-18 03:36
Iamusingrails3.2andmongoid.我正在使用rails3.2和mongoid。Imakethesestepsforsettingmydatabas
I am using rails 3.2
and mongoid
.
我正在使用rails 3.2和mongoid。
I make these steps for setting my database:
我做了以下设置我的数据库的步骤:
// Add an Admin User (to the admin db)
use admin
db.addUser("theadmin", "anadminpassword")
// Use your database
use superuser
// Add a user (to your database)
db.addUser("John", "passwordForJohn")
// show all users:
db.system.users.find()
// add readonly user (kinda cool)
db.addUser("readonly", "passwordForJohn", true)
In my mongo.yml
I have:
在我的草原。yml我有:
production:
host: localhost
port: 27017
username: John
password: passwordForJohn
database: namedatabase
You can see in http://www.mongodb.org/display/DOCS/Security+and+Authentication
您可以在http://www.mongodb.org/display/DOCS/Security+和+认证中看到
My problem is that now I try run:
我的问题是现在我试着跑:
rake db:seed
I get now this error:
我现在得到这个错误:
rake aborted!
Connection refused - connect(2)
How can I fix it?
我怎样才能修好它呢?
1 个解决方案