Mongoimport错误:SASL身份验证步骤上的服务器返回错误:BSON字段' saslContinue.mechanism'是一个未知领域

发布于 2025-01-28 06:03:03 字数 1235 浏览 2 评论 0原文

我正在尝试使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀中猫帐中妖 2025-02-04 06:03:03

花了几个小时后,我知道这是主机服务器上的Mongoimport版本。安装了Mongoimport,没有版本编号&因此犯了错误。

我使用以下命令安装MongoDB工具版本100.5.1

sudo apt-get --purge remove mongodb-org
sudo apt purge mongodb*
sudo dpkg -i --force-all mongodb-database-tools-ubuntu2004-x86_64-100.5.1.deb

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

sudo apt-get --purge remove mongodb-org
sudo apt purge mongodb*
sudo dpkg -i --force-all mongodb-database-tools-ubuntu2004-x86_64-100.5.1.deb
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文