Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

laravel8 设置mongodb之后抛出 'bcommand insert requires authentication' #3

Open
flaravel opened this issue Feb 23, 2021 · 5 comments

Comments

@flaravel
Copy link

可能需要
$uri = "mongodb://{$config['host']}:{$config['port']}";
修改为
$uri = "mongodb://{$config['username']}:{$config['password']}@{$config['host']}:{$config['port']}";

@jiannei
Copy link
Owner

jiannei commented Feb 23, 2021

可能需要
$uri = "mongodb://{$config['host']}:{$config['port']}";
修改为
$uri = "mongodb://{$config['username']}:{$config['password']}@{$config['host']}:{$config['port']}";

收到~

@jiannei
Copy link
Owner

jiannei commented Mar 12, 2021

@flaravel 你有尝试过在 config/logging.php 中设置 LOG_MONGODB_USERNAMELOG_MONGODB_PASSWORD

@flaravel
Copy link
Author

@jiannei 配置了的,在mongo驱动中,没有兼容账号密码,我按照上面那样做,就可以链接了

@flaravel
Copy link
Author

@jiannei 建议在加一个自定义事件,方便我们做自定义的数据收集

@jiannei
Copy link
Owner

jiannei commented Mar 16, 2021

@jiannei 建议在加一个自定义事件,方便我们做自定义的数据收集

可以提个 pull request 过来 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants