Mongoimport错误:SASL身份验证步骤上的服务器返回错误:BSON字段' saslContinue.mechanism'是一个未知领域
我正在尝试使用MongoDB Server以外的其他服务器上的以下命令将一些JSON文件导入MongoDB集合:
mongoimport --host IP --port 27017 -u myuser -p mypass --authenticationDatabase admin --db dbname --collection collection --drop --type json --file absolutejsonfilepath --jsonArray
它正在抛出以下错误:
server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
如果我在MongoDB Server上击中同一命令本身,那么它可以工作。我已经检查了所有凭据&其他细节。所有细节都是正确的。
版本
mongoDB版本:5.0.8
update
如果我使用-vvvv parameter运行命令(用于冗长输出),则我得到了:
2022-05-12T12:29:22.261+0000 checking options
2022-05-12T12:29:22.262+0000 dumping with object check disabled
2022-05-12T12:29:22.262+0000 will listen for SIGTERM, SIGINT, and SIGKILL
2022-05-12T12:29:22.283+0000 got error from options parsing: error connecting to db server: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
2022-05-12T12:29:22.283+0000 Failed: error connecting to db server: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
I am trying to import some json files to mongodb collections using following command on a server other than mongodb server:
mongoimport --host IP --port 27017 -u myuser -p mypass --authenticationDatabase admin --db dbname --collection collection --drop --type json --file absolutejsonfilepath --jsonArray
It is throwing following error:
server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
How ever If I hit the same command on mongodb server itself then it works. I have checked all credentials & other details. All details are correct.
version
mongodb version: 5.0.8
update
if I run the command using -vvvv parameter (for verbose output) then I got this:
2022-05-12T12:29:22.261+0000 checking options
2022-05-12T12:29:22.262+0000 dumping with object check disabled
2022-05-12T12:29:22.262+0000 will listen for SIGTERM, SIGINT, and SIGKILL
2022-05-12T12:29:22.283+0000 got error from options parsing: error connecting to db server: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
2022-05-12T12:29:22.283+0000 Failed: error connecting to db server: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
花了几个小时后,我知道这是主机服务器上的Mongoimport版本。安装了Mongoimport,没有版本编号&因此犯了错误。
我使用以下命令安装MongoDB工具版本100.5.1
After spending hours, I came to know that it was mongoimport version issue on host server. The mongoimport was installed without version number & hence went into errors.
I used following commands to install mongodb tools version 100.5.1