gpt4 book ai didi

Mongodb版本不匹配问题3.6到4.0升级

转载 作者:行者123 更新时间:2023-12-04 19:10:26 24 4
gpt4 key购买 nike

我已经安装了最新版本的 MongoDB,即 4.0.10。我正在使用 Ubuntu 18.04。

当我运行 mongod --version在腻子命令行中,我得到版本 4.0.10
但是当我在 Studio3T 中运行查询时 db.version();我得到版本 3.6.3
我跑了dpkg -l | grep mongo并得到以下输出。



请帮助我确定我在这里做错了什么。

最佳答案

3.6.3-0ubuntu1 来看,您似乎安装了两个 MongoDB。由 apt 安装, 和 4.0.10那里的版本。

页面Install MongoDB Community Edition on Ubuntu声明:

The mongodb package provided by Ubuntu is not maintained by MongoDB Inc. and conflicts with the mongodb-org package. To check if Ubuntu’s mongodb package is installed on the system, run sudo apt list --installed | grep mongodb. You can use sudo apt remove mongodb and sudo apt purge mongodb to remove and purge the mongodb package before attempting this procedure.



较旧的 3.6.3 似乎仍在端口 27017 中运行,因此这是 Studio3T 连接的端口。

为确保干净安装,最好通过以下方式进行干净安装:
  • 按照 Uninstall MongoDB Community Edition 中的说明进行操作
  • 使用 apt 删除 3.6.3按照上面的说明
  • 使用 Install MongoDB Community Edition on Ubuntu 中的过程重新安装.

  • 可能不需要再次卸载/重新安装所有内容,但您不希望有冲突的剩余文件,这会在 future 产生问题。

    如果您需要旧3.6.3中的数据,请做 mongodump在卸载它之前。您可以稍后恢复它。

    关于Mongodb版本不匹配问题3.6到4.0升级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56645627/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com