yii2吧 关注:132贴子:179
  • 0回复贴,共1

yii2连接mongo报错,Authentication failed

只看楼主收藏回复

mongo的版本是3.2的,已经加了auth,在mongo上也去人auth可用,密码和用户名都没有问题。
'mongodb' => [
'class' => '\yii\mongodb\Connection',
'dsn' => 'mongodb://han:123123@127.0.0.1:27017/demo',
],
yii2中这样配置,然后报错
Failed to connect to: 127.0.0.1:27017: Authentication failed on database 'demo' with username 'han': auth failed
谁能解答一下???


IP属地:北京1楼2017-01-03 16:31回复