英文:
Bot doesn't connect with MongoDB
问题
在过去的几天里,我想启动我的Discord机器人(我没有做任何更改)来测试一些东西,但是我得到了这个错误:
querySrv EREFUSED _mongodb._tcp.cluster0.pnqjgso.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:251:17) {
errno: undefined,
code: 'EREFUSED',
syscall: 'querySrv',
hostname: '_mongodb._tcp.cluster0.pnqjgso.mongodb.net'
}
我尝试了整整一个星期,但没有成功。密码和用户名是正确的,我可以使用相同的字符串在Mongo Compass中连接。而且我的互联网连接应该不是问题,它是有线的,通常工作正常。
有人知道这个问题的解决办法吗?感谢每一个答案。
附言:我尝试使用一个旧的连接字符串,但它们也不起作用,因为它们已经被弃用。我还把代码发送给住在我远离的朋友,他们也遇到了相同的错误,所以这不可能是地理位置的问题。
英文:
so in the past few days I wanted to start my Discord Bot (I made no changes) to test something and I got this Error:
querySrv EREFUSED _mongodb._tcp.cluster0.pnqjgso.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:251:17) {
errno: undefined,
code: 'EREFUSED',
syscall: 'querySrv',
hostname: '_mongodb._tcp.cluster0.pnqjgso.mongodb.net'
}
I tried it everyday for the past week, but no success. The password and User is correct, I can connect with the same string in the Mongo Compass. Also my internet connection should not be the problem, it's wired and normally works fine.
Does someone know a solution for this Problem? Thanks for every answer.
PS: I tried to use an older connection string but they won't work either because they're deprecated. I also sent the Code to my friends who live far away from me and they got the same error, so it can't be locale.
答案1
得分: 0
DNS错误是一种DNS故障,EREFUSED
表示DNS服务器拒绝了查询。
你可以尝试联系运营您的DNS服务的人,或者尝试使用其他DNS提供商,比如Google(8.8.8.8)。
英文:
That error is a DNS failure, EREFUSED
indicates the DNS server refused the query.
You could try contacting whoever runs your DNS service, or try using another DNS provider, like Google (8.8.8.8)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论