问题:require auth data to have schema version 3 but found 1
这是可以查看如下链接:
http://stackoverflow.com/questions/26723693/getting-an-error-trying-to-add-a-user-to-mongodb-2-6-5
简而言之是use admin db.getSiblingDB("admin").runCommand({authSchemaUpgrade: 1 })
创建一个用户:
参考链接: http://blog.163.com/dazuiba_008/blog/static/363349812014552224168/
1.首先进入 admin 数据库, auth认证成功后,转入需要创建用户的数据库
2.随后用以下语句:db.createUser( { user:"test", pwd:"test123", roles: [ { role:"dbOwner", db:"test" } ] } );
转载于:https://www.cnblogs.com/norsd/p/6359299.html