切换库:use 库名
显示所有的数据库:show dbs
创建集合:db.createCollection("collection_name",{capped:true,size:8388608}); //创建8个G固定大小的集合
显示所有的集合:show collections
创建用户授权:db.createUser({user:"username",pwd:"password",roles:[{role:"dbOwner",db:"dbname"}]})
切换库:use 库名
显示所有的数据库:show dbs
创建集合:db.createCollection("collection_name",{capped:true,size:8388608}); //创建8个G固定大小的集合
显示所有的集合:show collections
创建用户授权:db.createUser({user:"username",pwd:"password",roles:[{role:"dbOwner",db:"dbname"}]})
转载于:https://www.cnblogs.com/binz/p/11433791.html