iT邦幫忙

0

Mongo DB 怎麼備份

  • 分享至 

  • xImage

下面大概是哪裡有錯 (以下有改過uri所以不能連)

mongodump --uri=mongodb+srv://XXXXXXX-admin:fdfdfdfdfffs#@ruledata.tmqy1.mongodb.net/DbName --out C:\databaseDump

但從windows命令字元下跳出
Failed: can't create session: could not connect to server: connection() error occured during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1": (AtlasError) bad auth : Authentication failed.

揮揮手 iT邦研究生 5 級 ‧ 2022-03-08 09:31:37 檢舉
你連線的DB 有需要認證嗎?
Yaowen iT邦研究生 4 級 ‧ 2022-03-08 09:51:18 檢舉
只要uri 就可以用 Robo 3T 連到了
Cheng® iT邦新手 2 級 ‧ 2022-03-09 16:26:29 檢舉
試試
mongodump --host <host-ip> --port 27017 --db <database> --authenticationDatabase admin --username <username> --password <password> --out ./Documents/
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
iT邦新手 2 級 ‧ 2022-03-09 17:09:37
最佳解答

我直接登入點進 Cmd Line Tools 選項,去複製他的指令下來是這樣:
mongodump --uri mongodb+srv://<ACOUNT>:<PASSWORD>@xxxx.xxx.xxx.mongodb.net/<DATABASE>

看起來有幾個不同:

  1. --uri 後面沒有 =
  2. <PASSWORD>@ 中間沒有 #

不知道是不是這兩個地方的關係?

  • 在這複製指令:
    https://ithelp.ithome.com.tw/upload/images/20220309/201209819mpo2wA57M.png

我要發表回答

立即登入回答