1. <dd id="erndk"></dd>
                1. mongodb4.4 "errmsg" : "command insert requires authentication"

                  互聯網 2022/5/2 19:12:51

                  ----直接登錄 # mongo MongoDB shell version v4.4.11connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodbImplicit session: session { "id" : UUID("458c4287-f41d-4ab4-b8a9-92e082ff1809") }MongoDB…

                  ----直接登錄

                  # mongo
                  MongoDB shell version v4.4.11
                  connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
                  Implicit session: session { "id" : UUID("458c4287-f41d-4ab4-b8a9-92e082ff1809") }
                  MongoDB server version: 4.4.11

                  myReplSet:PRIMARY> use myNewDB
                  switched to db myNewDB
                  myReplSet:PRIMARY>
                  myReplSet:PRIMARY> db.myNewCollection1.insertOne( { x: 1 } )
                  uncaught exception: WriteCommandError({
                  "operationTime" : Timestamp(1651465601, 1),
                  "ok" : 0,
                  "errmsg" : "command insert requires authentication",
                  "code" : 13,
                  "codeName" : "Unauthorized",
                  "$clusterTime" : {
                  "clusterTime" : Timestamp(1651465601, 1),
                  "signature" : {
                  "hash" : BinData(0,"v8KZR6Phlm7I56O2d8yyubpCaxo="),
                  "keyId" : NumberLong("7050390538112991237")
                  }
                  }
                  }) :
                  WriteCommandError({
                  "operationTime" : Timestamp(1651465601, 1),
                  "ok" : 0,
                  "errmsg" : "command insert requires authentication",
                  "code" : 13,
                  "codeName" : "Unauthorized",
                  "$clusterTime" : {
                  "clusterTime" : Timestamp(1651465601, 1),
                  "signature" : {
                  "hash" : BinData(0,"v8KZR6Phlm7I56O2d8yyubpCaxo="),
                  "keyId" : NumberLong("7050390538112991237")
                  }
                  }
                  })
                  WriteCommandError@src/mongo/shell/bulk_api.js:417:48
                  executeBatch@src/mongo/shell/bulk_api.js:915:23
                  Bulk/this.execute@src/mongo/shell/bulk_api.js:1163:21
                  DBCollection.prototype.insertOne@src/mongo/shell/crud_api.js:264:9
                  @(shell):1:1

                   

                  -----輸入密碼進入控制臺

                  mongo -u root -p
                  MongoDB shell version v4.4.11
                  Enter password:
                  connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
                  Implicit session: session { "id" : UUID("6af88f61-8d30-4825-8b8e-619ea9d9d77e") }
                  MongoDB server version: 4.4.11
                  ---
                  The server generated these startup warnings when booting:
                  2022-01-07T17:15:33.016+08:00: You are running this process as the root user, which is not recommended
                  2022-01-07T17:15:33.017+08:00: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'
                  2022-01-07T17:15:33.017+08:00: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. We suggest setting it to 'never'
                  2022-01-07T17:15:33.017+08:00: Soft rlimits too low
                  2022-01-07T17:15:33.017+08:00: currentValue: 1024
                  2022-01-07T17:15:33.017+08:00: recommendedMinimum: 64000
                  ---
                  ---
                  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()
                  ---
                  myReplSet:PRIMARY>
                  myReplSet:PRIMARY>
                  myReplSet:PRIMARY> db.myNewCollection1.insertOne( { x: 1 } )
                  {
                  "acknowledged" : true,
                  "insertedId" : ObjectId("626f5e3c8e707aebf832ea62")
                  }
                  myReplSet:PRIMARY>
                  myReplSet:PRIMARY>
                  myReplSet:PRIMARY>
                  myReplSet:PRIMARY> show dbs;
                  accounts 0.000GB
                  admin 0.000GB
                  config 0.000GB
                  local 0.073GB
                  mock 0.049GB
                  test 0.000GB
                  myReplSet:PRIMARY>
                  myReplSet:PRIMARY> use locla
                  switched to db locla
                  myReplSet:PRIMARY> show tables;

                  myReplSet:PRIMARY> use test
                  switched to db test
                  myReplSet:PRIMARY> show tables;    -----默認在test庫下
                  myNewCollection1
                  test

                  myReplSet:PRIMARY> db.myNewCollection1.find();
                  { "_id" : ObjectId("626f5e3c8e707aebf832ea62"), "x" : 1 }

                  隨時隨地學軟件編程-關注百度小程序和微信小程序
                  關于找一找教程網

                  本站文章僅代表作者觀點,不代表本站立場,所有文章非營利性免費分享。
                  本站提供了軟件編程、網站開發技術、服務器運維、人工智能等等IT技術文章,希望廣大程序員努力學習,讓我們用科技改變世界。
                  [mongodb4.4 "errmsg" : "command insert requires authentication"]http://www.yachtsalesaustralia.com/tech/detail-318759.html

                  贊(0)
                  關注微信小程序
                  程序員編程王-隨時隨地學編程

                  掃描二維碼或查找【程序員編程王】

                  可以隨時隨地學編程啦!

                  技術文章導航 更多>
                  国产在线拍揄自揄视频菠萝

                        1. <dd id="erndk"></dd>