介绍:前面介绍过如何获取MongoDB Atlas
云数据库的一个mongodb
的实例,详情看
MySQL
、MongoDB
、PostgreSQL
三个开发者实例我们拿到实例可以干什么呢?
我主要是用MongoDB
来搭建leanote
,详情看 Leanote蚂蚁笔记-可私人搭建的笔记
MySQL
用来搭建lychee
相册,详情看
截图
注册账号
- 官网
验证邮箱
登录获取实例
1、登录进入管理页面,完善你的信息
2、点击Personal space
3、点击 an add-on
4、创建实例
提供了MySQL、MongoDB、PostgreSQL
三个开发者免费的共享实例,下面我罗列一下
MySQL规格
MongoDB规格
PostgreSQL规格
选择你想要的实例
5、然后选择免费的实例,滑动到底,点击next
6、设置实例名称,地区有法国,点击next
7、可以得到你的实例信息了
8、尝试连接
如下则连接成功
如果报错
根据你的系统安装mongodb
root@ecs-949d:~# apt install mongodb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libboost-chrono1.62.0 libboost-filesystem1.62.0 libboost-program-options1.62.0 libboost-regex1.62.0 libboost-system1.62.0 libboost-thread1.62.0
libgoogle-perftools4 libpcrecpp0v5 libsnappy1v5 libstemmer0d libtcmalloc-minimal4 libunwind8 libyaml-cpp0.5v5 mongo-tools mongodb-clients
mongodb-server
The following NEW packages will be installed:
libboost-chrono1.62.0 libboost-filesystem1.62.0 libboost-program-options1.62.0 libboost-regex1.62.0 libboost-system1.62.0 libboost-thread1.62.0
libgoogle-perftools4 libpcrecpp0v5 libsnappy1v5 libstemmer0d libtcmalloc-minimal4 libunwind8 libyaml-cpp0.5v5 mongo-tools mongodb mongodb-clients
mongodb-server
0 upgraded, 17 newly installed, 0 to remove and 34 not upgraded.
Need to get 45.9 MB of archives.
After this operation, 198 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian stretch/main amd64 libpcrecpp0v5 amd64 2:8.39-3 [151 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libboost-system1.62.0 amd64 1.62.0+dfsg-4 [32.4 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 libboost-chrono1.62.0 amd64 1.62.0+dfsg-4 [36.0 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 libboost-filesystem1.62.0 amd64 1.62.0+dfsg-4 [63.2 kB]
Get:5 http://deb.debian.org/debian stretch/main amd64 libboost-program-options1.62.0 amd64 1.62.0+dfsg-4 [159 kB]
Get:6 http://deb.debian.org/debian stretch/main amd64 libboost-regex1.62.0 amd64 1.62.0+dfsg-4 [288 kB]
Get:7 http://deb.debian.org/debian stretch/main amd64 libboost-thread1.62.0 amd64 1.62.0+dfsg-4 [71.5 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 libtcmalloc-minimal4 amd64 2.5-2.2 [121 kB]
Get:9 http://deb.debian.org/debian stretch/main amd64 libunwind8 amd64 1.1-4.1 [48.7 kB]
Get:10 http://deb.debian.org/debian stretch/main amd64 libgoogle-perftools4 amd64 2.5-2.2 [224 kB]
Get:11 http://deb.debian.org/debian stretch/main amd64 libstemmer0d amd64 0+svn585-1+b2 [63.3 kB]
Get:12 http://deb.debian.org/debian stretch/main amd64 libyaml-cpp0.5v5 amd64 0.5.2-4 [151 kB]
Get:13 http://deb.debian.org/debian stretch/main amd64 mongo-tools amd64 3.2.11-1+b3 [12.2 MB]
Get:14 http://deb.debian.org/debian stretch/main amd64 libsnappy1v5 amd64 1.1.3-3 [51.0 kB]
Get:15 http://deb.debian.org/debian stretch/main amd64 mongodb-clients amd64 1:3.2.11-2+deb9u1 [20.4 MB]
Get:16 http://deb.debian.org/debian stretch/main amd64 mongodb-server amd64 1:3.2.11-2+deb9u1 [11.8 MB]
Get:17 http://deb.debian.org/debian stretch/main amd64 mongodb amd64 1:3.2.11-2+deb9u1 [16.9 kB]
Fetched 45.9 MB in 0s (86.0 MB/s)
Selecting previously unselected package libpcrecpp0v5:amd64.
(Reading database ... 40338 files and directories currently installed.)
Preparing to unpack .../00-libpcrecpp0v5_2%3a8.39-3_amd64.deb ...
Progress: [ 0%] [...................................................................................................................................]
Unpacking libpcrecpp0v5:amd64 (2:8.39-3) ............................................................................................................]
Progress: [ 97%] [###############################################################################################################################....]
Processing triggers for libc-bin (2.24-11+deb9u4) ...##############################################################################################..]
Processing triggers for systemd (232-25+deb9u12) ...
root@ecs-949d:~# mongo -version
MongoDB shell version: 3.2.11
root@ecs-949d:~#
出现 MongoDB shell version: 3.2.11
便可重新连接数据库
其他的MySQL
、PostgreSQL
步骤像上面一样便可
[1]: https://www.k6366.com.cn/index.php/archives/102/ [2]: https://jscdn.cachefly.net/web/wxiou/20200720133130.png [3]: https://www.clever-cloud.com/ [4]: https://jscdn.cachefly.net/web/wxiou/20200720134016.png [5]: https://jscdn.cachefly.net/web/wxiou/20200720135803.png [6]: https://jscdn.cachefly.net/web/wxiou/20200720134151.png [7]: https://jscdn.cachefly.net/web/wxiou/20200720134426.png [8]: https://jscdn.cachefly.net/web/wxiou/20200720134532.png [9]: https://jscdn.cachefly.net/web/wxiou/20200720134807.png [10]: https://jscdn.cachefly.net/web/wxiou/20200720134929.png [11]: https://jscdn.cachefly.net/web/wxiou/20200720135046.png [12]: https://jscdn.cachefly.net/web/wxiou/20200720135131.png [13]: https://jscdn.cachefly.net/web/wxiou/20200720135214.png [14]: https://jscdn.cachefly.net/web/wxiou/20200720135331.png [15]: https://jscdn.cachefly.net/web/wxiou/20200720135604.png [16]: https://jscdn.cachefly.net/web/wxiou/20200720135957.png [17]: https://jscdn.cachefly.net/web/wxiou/20200720141450.png [18]: https://jscdn.cachefly.net/web/wxiou/20200720141305.png