mongo db不连接

发布于 2025-02-12 15:54:55 字数 589 浏览 1 评论 0原文

我有使用各种DB的Drupal8应用程序。当我尝试通过提供用户名和密码与Mongo DB连接时,连接不会发生。我可以单独提及服务器地址与Mongo DB联系。

注意:MongoDB在我的服务器中配置了用户名和密码 我尝试了以下方法。

$this->connect_string = 'mongodb://user:password@serveraddress';  (not connecting)             
$this->connect_string = 'mongodb://serveraddress';        (connecting)        
#$this->connect_string = 'mongodb://user:password@serveraddress:27017/?authSource=dbname';(not connecting)

Drupal 8 PHP V-7.4

开发了自定义模块,以与Mongo DB连接,以显示新闻提要(Mongo DB中存储的新闻提要的信息)。

如何传递用户名&密码与Mongo DB连接? 在MongoDB服务器中找不到任何错误日志。

I have drupal8 application where I use various dbs. When i try to connect with mongo db by giving username and password, connection is not happening. I could connect with mongo db by mentioning server address alone.

note: mongodb is configured with username and password in my server
I tried below methods.

$this->connect_string = 'mongodb://user:password@serveraddress';  (not connecting)             
$this->connect_string = 'mongodb://serveraddress';        (connecting)        
#$this->connect_string = 'mongodb://user:password@serveraddress:27017/?authSource=dbname';(not connecting)

Php v-7.4, Drupal 8

developed custom module to connect with mongo db, to display news feed (news feed related information stored in mongo db).

how to pass user name & password to connect with mongo db?
Could not find any error logs in mongodb server.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文