我试图允许mongo用户连接到mongo数据库,但是无论我给用户分配了什么角色,身份验证都会失败,因为日志中有此错误:
2019-08-09T17:03:05.486+0000 I ACCESS [conn13] SCRAM-SHA-1 authentication failed for username on dbname from client 127.0.0.1:38790 ; UserNotFound: Could not find user username@dbname
2019-08-09T17:03:05.488+0000 I NETWORK [conn13] end c
在这里运行于Ubuntu 14上的noob node.js、Express和MongoDB;我通过以下方式在express/nodejs应用数据库中创建了一只猫鼬:
var mongoose = require('mongoose');
var express = require('express');
var app = express();
...
mongoose.connect("mongodb://localhost/firstExpress");
var UserSchema = new mongoose.Schema({
na