-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
用mongo子账号在客户端可以连接到某个db的,所以权限没问题的,同样的问题在以下链接看到了
tp5 mongodb Authentication failed(认证失败)
建议connector/Mongo.php 135行dsn增加database的配置
修改前:
$config['dsn'] = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '');
修改后
$config['dsn'] = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '').($config['database'] ? "/{$config['database']}" : '');
Metadata
Metadata
Assignees
Labels
No labels