Skip to content

安装了1.8.5版本,普通用户无法查询数据。超级管理可以 #85

Description

@lepig

我用的是ThinkPHP5.0.22.
我在extra目录下建立了一个文件叫mongo.php内容如下

return [
    'type'          =>   '\think\mongo\Connection',
    'hostname'      =>   '1.2.3.4',
    'database'      =>   'fa_brand',
    'username'      =>   'mongodb',
    'password'      =>   'pre-mongodb',
    'hostport'      =>   '2000',
    'prefix'        => '',
    'pk_convert_id' => true,
    'debug'         => false,
];

这样配置了以后,查询数据报

not authorized on fa_brand to execute command { find: "brand_user", filter: {}, projection: {}, limit: 0 }

但是我使用mongodb这个用户通过命令行是可以查询出来的。

最后我把username这个用户换成了超级管理员,却可以查询出来。 很奇怪啊 。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions