惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LINUX DO - 热门话题
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threat Research - Cisco Blogs
AI
AI
B
Blog RSS Feed
S
Schneier on Security
雷峰网
雷峰网
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
罗磊的独立博客
有赞技术团队
有赞技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
博客园 - Franky
Attack and Defense Labs
Attack and Defense Labs
The Cloudflare Blog
Webroot Blog
Webroot Blog
Last Week in AI
Last Week in AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
美团技术团队
L
Lohrmann on Cybersecurity
T
The Blog of Author Tim Ferriss
The Last Watchdog
The Last Watchdog
T
Troy Hunt's Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
Know Your Adversary
Know Your Adversary
O
OpenAI News
博客园 - 【当耐特】
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
Cybersecurity and Infrastructure Security Agency CISA
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
PCI Perspectives
PCI Perspectives
H
Heimdal Security Blog
I
InfoQ
GbyAI
GbyAI
T
Threatpost
C
Cisco Blogs

博客园 - 马会东

Llama3 在HumanEval中的表现 在 Apple Silicon Mac(M1、M2 或 M3)上运行最新 LLM 模型 Meta Llama 3 的分步指南 mamp nginx thinkphp5 配置方法 centos8 yum 安装rabbitmq dotnet new 命令 ACE Editor(代码编辑器) 入门教程 如何在Curl中使用Socks5代理 知识付费平台 快速开发框架(管理系统-持续更新) mysql 索引优化原则总结(limit where in like ) MySQL高级知识——Order By关键字优化 mysql索引的排列顺序 解决MySQL使用limit偏移量较大效率慢的问题 tar命令详解 systemctl命令列出所有服务 Git的撤销、修改和回退命令 使用git时显示untracked files(未监控)解决办法 MySQL中Case When用法详解 计算机指令-流水线和吞吐率
在mac上使用docker部署Mongo数据库
马会东 · 2023-04-24 · via 博客园 - 马会东

拉取镜像

  1. 打开网址 https://hub.docker.com/ ,搜索 mongo ,https://hub.docker.com/_/mongo
  2. 执行命令 docker pull mongo

启动容器

  1. 执行命令 docker image ,查看到 mongo的tag是 5.0.16
  2. 启动命令 docker run -dit --name mongo5 -p 27017:27017 -v /Users/huidongma/data/mongodb:/data/db -e MONGO_INITDB_ROOT_USERNAME=smkdb -e MONGO_INITDB_ROOT_PASSWORD=smkdb123 mongo:5.0.16

创建用户并授权数据库

  1. 进入容器 docker exec -it /bin/bash
  2. 链接数据库 mongo -u smkdb -p smkdb123
  3. 创建用户:
    use smkdb
    db.createUser({
    user: "smkdb",
    pwd: "smkdb123",
    roles: [{role: "readWrite", db: "smkdb"}]
    })

导入数据库备份

mongorestore -u smkdb -p smkdb123 --db smkdb /data/db/mhd

posted on 2023-04-24 20:47  马会东  阅读(182)  评论()    收藏  举报