thinkphp5 mongodb Authentication failed
thinkphp5 mongodb Authentication failed 解决办法
Bulk write failed due to previous MongoDB\Driver\Exception\AuthenticationException: Authentication failed.
原因是
/vendor/topthink/think-mongo/src/Connection.php
文件中connect
方法(大概189行左右)在拼接dns的时候缺少参数
$config['dsn'] = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '');
dns格式是mongodb://username:passwd@localhost:3306/DbName?param1=val1¶m2=val2#utf8
参数补齐就行了
$config['dsn'] = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '') . "/" . $config['database'] ;
thinkphp5 mongodb Authentication failed相关推荐
- mongodb php 报错,PHP5 mongodb 切换db报错 Authentication failed on database admin-汗血宝马
权限 已经开启,在test上创建了用户test1,并赋予了 test的readWrite 和 reporting的read权限. { "_id" : "test.test ...
- spring.data.mongodb.uri认证失败Authentication failed
使用spring.data.mongodb.uri=mongodb://root:ve#duj7-wa06yhg$@192.154.81.16:27017/xxxx老是出现Authentication ...
- ‘Authentication failed.‘ on server xx.xx.xxx.x:27017. The full response is { “ok“ : 0.0, “errmsg“
异常产生环境 在SpringBoot项目中使用yml文件连接mongodb产生(mongodb带密码验证) 异常描述 com.mongodb.MongoCommandException: Comman ...
- db.auth(‘admin‘,‘123456‘) Error: Authentication failed. 0
1.通过mongoDB compass连接地址:mongodb://admin:123456@localhost:27017/ 显示连接不上 2.那么我看一看通过命令行能不能连接,输入mongo可以连 ...
- mongodb-golang 权限验证报错:SASL authentication step: Authentication failed
起因 1,今天在将服务查询db从mysql迁移至mongodb的时候,发现报错如下: {"level":"error","time":&qu ...
- { ok : 0.0, errmsg : Authentication failed., code : 18, codeName : AuthenticationFailed
调用接口向mongoDB数据库写数据失败 背景:写了一个springboot整合mongoDB的小demo. 调用接口往数据库写入数据的时候,异常信息如下: com.mongodb.MongoComm ...
- 单点登录(十)-----遇到问题-----cas启用mongodb验证方式报错com.mongodb.CommandFailureException---Authentication failed
cas启用mongodb验证方式报错com.mongodb.CommandFailureException---Authentication failed. 完整报错信息: 二月 08, 2017 5 ...
- git配置报错fatal: Authentication failed for ‘‘问题解决
git配置报错fatal: Authentication failed for ''问题解决 参考文章: (1)git配置报错fatal: Authentication failed for ''问题 ...
- svn: E215004: Authentication failed
Linux环境配置安装好SVN服务器后,输入命令: svn co svn:// IP : PORT 结果返回Authentication failed [root]@iZ23whn33Z conf]# ...
最新文章
- linux双网卡绑定+单网卡多IP绑定
- 人脸识别 python调用face++ 功能测试
- WinForm下的键盘事件(KeyPress、KeyDown)及如何处理不响应键盘事件
- .NET Core实战项目之CMS 第一章 入门篇-开篇及总体规划
- c程序怎么改为java程序_如何将Java程序的入口点更改为C签名?
- java布尔类型比较器_浅谈Java中几种常见的比较器的实现方法
- Win7下建立Wifi热点
- Python学习之OS模块初识
- POJ1061 青蛙的约会(拓展欧几里德)
- git上传代码前需要检查什么_肝功能检查前需要做什么准备?这6个要点需做好,以免准确度受影响...
- CloudComparePCL 主曲率、平均曲率以及高斯曲率计算
- double转换成百分数
- qpython3l_qpython3例子
- php企业微信回调url校验失败,企业微信第三方服务商回调URL无法通过验证
- C语言学习--01 认识数据类型
- 给自己:得失心莫太重,功利心莫太强
- php中可以表示当前日期的函数,在PHP中,可以使用()函数来获取当前日期和时间...
- 解决部署Hexo后出现的The custom domain for your GitHub Pages site is pointed at an outdated IP address警告
- Mac下的串口调试工具(2018更新)
- DOS DDOS DRDOS原理