当前位置: 首页 > news >正文

做网站开源免费网站的软件

做网站开源,免费网站的软件,营销型网站 案例,邯郸网站制作哪家好一、安装MongoDB 忽略 二、创建账号和授权 在新的MongoDB上创建用户管理员。先切换到admin库,然后通过命令创建数据库管理员账号和密码。最后再验证账号密码是否创建成功! use admin db.createUser({user:"root",pwd:"123456Ab",…

一、安装MongoDB

忽略

二、创建账号和授权
  1. 在新的MongoDB上创建用户管理员。先切换到admin库,然后通过命令创建数据库管理员账号和密码。最后再验证账号密码是否创建成功!
use admin
db.createUser({user:"root",pwd:"123456Ab",roles:["userAdminAnyDatabase"]})
db.auth("root","123456Ab") #返回1表示登录成功

过程记录

C:\Users\administrator>mongo
MongoDB shell version v3.6.23
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("9c8640d6-7b58-4220-b2a5-286938940a38") }
MongoDB server version: 3.6.23
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, seehttp://docs.mongodb.org/
Questions? Try the support grouphttp://groups.google.com/group/mongodb-user
> use admin
switched to db admin
> db.createUser({user:"root",pwd:"123456Ab",roles:["userAdminAnyDatabase"]})
Successfully added user: { "user" : "root", "roles" : [ "userAdminAnyDatabase" ] }
> db.auth("root","123456Ab")
1
> exit
byeC:\Users\administrator>
  1. 在指定数据库上创建用户。

先切换到admin库,然后验证刚刚创建的管理root账号,再切换到新的ramsey数据库,通过命令创建账号和授权。

use admin
db.auth("root","123456Ab")
use ramsey
db.createUser({user:"ss",pwd:"secret",roles:[{role:"dbOwner", db:"ramsey"}]})

过程记录

C:\Users\administrator>mongo
MongoDB shell version v3.6.23
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("930e2c76-530e-4345-8840-4705075e2646") }
MongoDB server version: 3.6.23
>
> use admin
switched to db admin
> db.auth("root","123456Ab")
1
> use ramsey
switched to db ramsey
> db.createUser({user:"ss",pwd:"secret",roles:[{role:"dbOwner", db:"ramsey"}]})
Successfully added user: {"user" : "ss","roles" : [{"role" : "dbOwner","db" : "ramsey"}]
}
>
> exit
byeC:\Users\administrator>
三、恢复Mongodb数据

通过下面命令恢复数据

-- restore
mongorestore -h 127.0.0.1 --port 27017 -u ss -p secret -d ramsey C:\Mongodump\ramsey >> C:\Mongodump\ramsey\restore.log

过程记录

C:\Users\administrator>mongorestore -h 127.0.0.1 --port 27017 -u ss -p secret -d ramsey C:\Mongodump\ramsey >> C:\Mongodump\ramsey\restore.log
2024-07-16T15:17:24.818+0800    the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead
2024-07-16T15:17:24.820+0800    building a list of collections to restore from C:\Mongodump\ramsey dir
2024-07-16T15:17:24.827+0800    don't know what to do with file "C:\Mongodump\ramsey\restore.log", skipping...
2024-07-16T15:17:24.833+0800    reading metadata for ramsey.sent_item from C:\Mongodump\ramsey\sent_item.metadata.json
2024-07-16T15:17:24.838+0800    reading metadata for ramsey.sent_item_archive from C:\Mongodump\ramsey\sent_item_archive.metadata.json
2024-07-16T15:17:24.839+0800    reading metadata for ramsey.failed_item from C:\Mongodump\ramsey\failed_item.metadata.json
2024-07-16T15:17:24.904+0800    reading metadata for ramsey.failed_item_archive from C:\Mongodump\ramsey\failed_item_archive.metadata.json
2024-07-16T15:17:24.915+0800    restoring ramsey.sent_item from C:\Mongodump\ramsey\sent_item.bson
2024-07-16T15:17:24.950+0800    restoring ramsey.failed_item from C:\Mongodump\ramsey\failed_item.bson
2024-07-16T15:17:24.964+0800    restoring ramsey.sent_item_archive from C:\Mongodump\ramsey\sent_item_archive.bson
2024-07-16T15:17:25.733+0800    restoring ramsey.failed_item_archive from C:\Mongodump\ramsey\failed_item_archive.bson
2024-07-16T15:17:28.184+0800    [........................]            ramsey.sent_item  47.7MB/6.46GB   (0.7%)
2024-07-16T15:17:28.186+0800    [######..................]          ramsey.failed_item   49.0MB/176MB  (27.7%)
2024-07-16T15:17:28.191+0800    [........................]    ramsey.sent_item_archive  42.6MB/1.30GB   (3.2%)
2024-07-16T15:17:28.192+0800    [###############.........]  ramsey.failed_item_archive  48.6MB/73.9MB  (65.8%)
2024-07-16T15:17:28.193+0800
2024-07-16T15:17:29.870+0800    [########################]  ramsey.failed_item_archive  73.9MB/73.9MB  (100.0%)
2024-07-16T15:17:29.879+0800    no indexes to restore
2024-07-16T15:17:29.886+0800    finished restoring ramsey.failed_item_archive (7526 documents)
2024-07-16T15:17:29.892+0800    reading metadata for ramsey.sending from C:\Mongodump\ramsey\sending.metadata.json
2024-07-16T15:17:29.934+0800    restoring ramsey.sending from C:\Mongodump\ramsey\sending.bson
2024-07-16T15:17:29.940+0800    no indexes to restore
2024-07-16T15:17:29.942+0800    finished restoring ramsey.sending (0 documents)
2024-07-16T15:17:30.808+0800    [........................]          ramsey.sent_item  108MB/6.46GB   (1.6%)
2024-07-16T15:17:30.820+0800    [##############..........]        ramsey.failed_item   107MB/176MB  (60.4%)
2024-07-16T15:17:30.847+0800    [#.......................]  ramsey.sent_item_archive  104MB/1.30GB   (7.9%)
2024-07-16T15:17:30.850+0800
2024-07-16T15:17:33.748+0800    [........................]          ramsey.sent_item  169MB/6.46GB   (2.6%)
2024-07-16T15:17:33.750+0800    [#####################...]        ramsey.failed_item   156MB/176MB  (88.3%)
2024-07-16T15:17:33.753+0800    [###.....................]  ramsey.sent_item_archive  179MB/1.30GB  (13.5%)
2024-07-16T15:17:33.758+0800
2024-07-16T15:17:34.348+0800    [########################]  ramsey.failed_item  176MB/176MB  (100.0%)
2024-07-16T15:17:34.348+0800    no indexes to restore
2024-07-16T15:17:34.355+0800    finished restoring ramsey.failed_item (18145 documents)
2024-07-16T15:17:36.757+0800    [........................]          ramsey.sent_item  263MB/6.46GB   (4.0%)
2024-07-16T15:17:36.757+0800    [#####...................]  ramsey.sent_item_archive  303MB/1.30GB  (22.9%)
2024-07-16T15:17:36.761+0800
2024-07-16T15:17:39.749+0800    [#.......................]          ramsey.sent_item  313MB/6.46GB   (4.7%)
2024-07-16T15:17:39.753+0800    [#######.................]  ramsey.sent_item_archive  431MB/1.30GB  (32.5%)
2024-07-16T15:17:39.758+0800
2024-07-16T15:17:42.748+0800    [#.......................]          ramsey.sent_item  361MB/6.46GB   (5.5%)
2024-07-16T15:17:42.748+0800    [#########...............]  ramsey.sent_item_archive  548MB/1.30GB  (41.3%)
2024-07-16T15:17:42.755+0800
2024-07-16T15:17:45.748+0800    [#.......................]          ramsey.sent_item  426MB/6.46GB   (6.4%)
2024-07-16T15:17:45.749+0800    [############............]  ramsey.sent_item_archive  675MB/1.30GB  (50.9%)
2024-07-16T15:17:45.755+0800
2024-07-16T15:17:48.748+0800    [#.......................]          ramsey.sent_item  490MB/6.46GB   (7.4%)
2024-07-16T15:17:48.749+0800    [###############.........]  ramsey.sent_item_archive  842MB/1.30GB  (63.4%)
2024-07-16T15:17:48.750+0800
2024-07-16T15:17:51.748+0800    [##......................]          ramsey.sent_item   616MB/6.46GB   (9.3%)
2024-07-16T15:17:51.750+0800    [##################......]  ramsey.sent_item_archive  1014MB/1.30GB  (76.4%)
2024-07-16T15:17:51.753+0800
2024-07-16T15:17:54.853+0800    [##......................]          ramsey.sent_item   719MB/6.46GB  (10.9%)
2024-07-16T15:17:54.854+0800    [####################....]  ramsey.sent_item_archive  1.13GB/1.30GB  (87.1%)
2024-07-16T15:17:54.877+0800
2024-07-16T15:17:57.748+0800    [##......................]          ramsey.sent_item   812MB/6.46GB  (12.3%)
2024-07-16T15:17:57.752+0800    [#######################.]  ramsey.sent_item_archive  1.28GB/1.30GB  (98.9%)
2024-07-16T15:17:57.758+0800
2024-07-16T15:17:58.115+0800    [########################]  ramsey.sent_item_archive  1.30GB/1.30GB  (100.0%)
2024-07-16T15:17:58.115+0800    no indexes to restore
2024-07-16T15:17:58.120+0800    finished restoring ramsey.sent_item_archive (135502 documents)
2024-07-16T15:18:00.748+0800    [###.....................]  ramsey.sent_item  940MB/6.46GB  (14.2%)
2024-07-16T15:18:03.770+0800    [####....................]  ramsey.sent_item  1.09GB/6.46GB  (16.9%)
2024-07-16T15:18:06.748+0800    [####....................]  ramsey.sent_item  1.23GB/6.46GB  (19.0%)
2024-07-16T15:18:09.770+0800    [#####...................]  ramsey.sent_item  1.43GB/6.46GB  (22.1%)
2024-07-16T15:18:12.747+0800    [#####...................]  ramsey.sent_item  1.58GB/6.46GB  (24.5%)
2024-07-16T15:18:15.749+0800    [######..................]  ramsey.sent_item  1.76GB/6.46GB  (27.3%)
2024-07-16T15:18:18.756+0800    [######..................]  ramsey.sent_item  1.87GB/6.46GB  (29.0%)
2024-07-16T15:18:21.747+0800    [#######.................]  ramsey.sent_item  2.06GB/6.46GB  (31.8%)
2024-07-16T15:18:24.800+0800    [########................]  ramsey.sent_item  2.25GB/6.46GB  (34.8%)
2024-07-16T15:18:27.747+0800    [#########...............]  ramsey.sent_item  2.44GB/6.46GB  (37.8%)
2024-07-16T15:18:30.747+0800    [#########...............]  ramsey.sent_item  2.62GB/6.46GB  (40.5%)
2024-07-16T15:18:33.747+0800    [##########..............]  ramsey.sent_item  2.77GB/6.46GB  (42.8%)
2024-07-16T15:18:36.748+0800    [##########..............]  ramsey.sent_item  2.95GB/6.46GB  (45.6%)
2024-07-16T15:18:39.747+0800    [###########.............]  ramsey.sent_item  3.13GB/6.46GB  (48.4%)
2024-07-16T15:18:42.747+0800    [############............]  ramsey.sent_item  3.34GB/6.46GB  (51.7%)
2024-07-16T15:18:45.748+0800    [#############...........]  ramsey.sent_item  3.52GB/6.46GB  (54.5%)
2024-07-16T15:18:48.758+0800    [#############...........]  ramsey.sent_item  3.70GB/6.46GB  (57.3%)
2024-07-16T15:18:51.750+0800    [##############..........]  ramsey.sent_item  3.87GB/6.46GB  (59.9%)
2024-07-16T15:18:54.747+0800    [###############.........]  ramsey.sent_item  4.09GB/6.46GB  (63.3%)
2024-07-16T15:18:57.747+0800    [################........]  ramsey.sent_item  4.31GB/6.46GB  (66.8%)
2024-07-16T15:19:00.784+0800    [################........]  ramsey.sent_item  4.53GB/6.46GB  (70.1%)
2024-07-16T15:19:03.760+0800    [#################.......]  ramsey.sent_item  4.71GB/6.46GB  (72.9%)
2024-07-16T15:19:06.747+0800    [##################......]  ramsey.sent_item  4.94GB/6.46GB  (76.4%)
2024-07-16T15:19:09.747+0800    [###################.....]  ramsey.sent_item  5.13GB/6.46GB  (79.4%)
2024-07-16T15:19:12.747+0800    [###################.....]  ramsey.sent_item  5.34GB/6.46GB  (82.7%)
2024-07-16T15:19:15.844+0800    [####################....]  ramsey.sent_item  5.57GB/6.46GB  (86.2%)
2024-07-16T15:19:18.748+0800    [#####################...]  ramsey.sent_item  5.79GB/6.46GB  (89.7%)
2024-07-16T15:19:21.747+0800    [######################..]  ramsey.sent_item  6.00GB/6.46GB  (92.9%)
2024-07-16T15:19:24.747+0800    [#######################.]  ramsey.sent_item  6.21GB/6.46GB  (96.2%)
2024-07-16T15:19:27.816+0800    [#######################.]  ramsey.sent_item  6.40GB/6.46GB  (99.1%)
2024-07-16T15:19:28.762+0800    [########################]  ramsey.sent_item  6.46GB/6.46GB  (100.0%)
2024-07-16T15:19:28.762+0800    restoring indexes for collection ramsey.sent_item from metadata
2024-07-16T15:20:13.627+0800    finished restoring ramsey.sent_item (676453 documents)
2024-07-16T15:20:13.627+0800    doneC:\Users\administrator>

http://www.mmbaike.com/news/21947.html

相关文章:

  • 网站开发辛苦吗什么是论坛推广
  • WordPress交互式网站搜索引擎优化介绍
  • 做网站用什么工具好关键词查找
  • 设计网站软件开发网络推广员是干什么的
  • 做pc端网站价格如何免费做视频二维码永久
  • 有视频做的很好的网站吗seo外包公司优化
  • 网站建设公司好不好宁波seo网络推广优质团队
  • 网站注册页面html夸克搜索引擎入口
  • 哪个网站是做韩国化妆品正品网络营销推广的手段
  • .net 网站 数据库配置文件网络营销师证书有用吗
  • 厦门网站建设公司排行榜成都网站seo外包
  • zblog可以做视频网站吗计算机培训短期速成班
  • 网站建设哪些字体没有版权广告文案经典范例200字
  • 布吉做网站sem是什么电镜
  • 网站建设培训品牌网络营销推广方案策划
  • wordpress好看的主题seo软件推广
  • 网站推广公司兴田德润官网多少整合营销
  • 泉州市网站建设淘宝代运营靠谱吗
  • 昆明网站建设网站推广平台搭建
  • 做外贸必应网站产品曝光万网建站
  • 贸易公司网站源码台州seo优化
  • 北京网站制作培训学电脑培训班多少一个月
  • 微信开发人是谁广州seo推荐
  • 优质做网站哪家正规最新的域名网站
  • net网站建设语言关键词排名优化顾问
  • 360极速浏览器网站开发缓存外贸订单怎样去寻找
  • 合肥建立网站搜索引擎的网站
  • 怎么注册微网站网站模板价格
  • 建设网站网竞价 推广
  • 有哪些建设网站公司吗洛阳seo博客