无法使用 Tableau 或 Python 连接到 MongoDB 服务器,但可以在 Windows 10 上使用 Compass 连接到 MongoDB

问题描述 投票:0回答:1

通过将 conn 字符串粘贴到 Windows 10 上的 MongoDB Compass 中来访问 MongoDB 服务器非常容易,但当涉及到 Python 或 Tableau 时,它会返回错误

对于 Python 来说,要么是超时,要么:

Configuration Error: The DNS query name does not exist: _mongodb._tcp.mac88stage.sui9p.mongodb.net.
from pymongo import MongoClient

# Connection URI
uri = "mongodb+srv://USERNAME:[email protected]/"

client = MongoClient(uri)

db = client.db_name

collection = db.table_name

top_10_rows = collection.find().limit(10)

for row in top_10_rows:
    print(row)

创建 DSN 时(遵循本指南:https://www.mongodb.com/docs/atlas/tutorial/create-system-dsn/

我明白了

Unknown MySQL Driver Host

对于 Tableau,遵循标准指南: https://help.tableau.com/current/pro/desktop/en-us/examples_mongodb.htm 将驱动程序和连接器添加到 Tableau 中的相关文件夹中,但出现与 Python 类似的错误

python mongodb tableau-desktop mongodb-biconnector
1个回答
0
投票

您是否尝试在 DNS 部分下添加 google DNS 服务器 在您的 DNS 条目中添加

8.8.8.8
并尝试连接。

© www.soinside.com 2019 - 2024. All rights reserved.