質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
MongoDB

MongoDBはオープンソースのドキュメント指向データベースの1つです。高性能で、多くのリトルエンディアンシステムを利用することができます。

Q&A

1回答

1229閲覧

MongoDB ユーザ認証

question_user

総合スコア4

MongoDB

MongoDBはオープンソースのドキュメント指向データベースの1つです。高性能で、多くのリトルエンディアンシステムを利用することができます。

0グッド

1クリップ

投稿2020/03/16 04:48

前提・実現したいこと

MongoDB Community でユーザ認証の設定を行いたい。

発生している問題・エラーメッセージ

マニュアル通りにMongoDBのユーザ認証の設定を行ったのですが、ユーザ認証が機能しません。
解決方法をお伺いしたいです。

configファイルは以下の通りで、

storage: dbPath: C:\Program Files\MongoDB\Server\4.2\data journal: enabled: true systemLog: destination: file logAppend: true path: C:\Users\Documents\mongod.log net: port: 27017 bindIp: 0.0.0.0 security: authorization: enabled

ユーザ認証の設定は行っているのですが、mongodを起動して、

C:\Program Files\MongoDB\Server\4.2\bin>mongod --config "C:\Program Files\MongoDB\Server\4.2\bin\mongod.cfg"

mongoを起動すると、

C:\Program Files\MongoDB\Server\4.2\bin>mongo MongoDB shell version v4.2.3 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("13f49ac4-43ff-4f44-ae7d-0c9cf5cc16af") } MongoDB server version: 4.2.3 Server has startup warnings: 2020-03-10T16:15:30.818+0900 I CONTROL [initandlisten] 2020-03-10T16:15:30.818+0900 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2020-03-10T16:15:30.818+0900 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2020-03-10T16:15:30.819+0900 I CONTROL [initandlisten] --- Enable MongoDB's free cloud-based monitoring service, which will then receive and display metrics about your deployment (disk utilization, CPU, operation statistics, etc). The monitoring data will be available on a MongoDB website with a unique URL accessible to you and anyone you share the URL with. MongoDB may use this information to make product improvements and to suggest MongoDB products and deployment options to you. To enable free monitoring, run the following command: db.enableFreeMonitoring() To permanently disable this reminder, run the following command: db.disableFreeMonitoring()

となりユーザ認証が機能しません。

> use admin switched to db admin

宜しくお願いします。

補足情報(FW/ツールのバージョンなど)

MongoDB Community Server

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

adminの登録やロール設定はできていますか?

登録済み

> db.auth('admin', 'パスワード') 1

未登録

> db.auth('admin', 'パスワード') Error: Authentication failed. 0 >

投稿2020/03/16 05:50

technocore

総合スコア7225

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問