参考连接html
http://www.javashuo.com/article/p-efnbmhzq-dp.htmlmysql
https://blog.csdn.net/xlengji/article/details/81052151sql
Ubuntu16.04安装mongodbmongodb
sudo apt-get install mongodb mongo -version # 查看MongoDB版本 # 启动和关闭mongodb命令 service mongodb start service mongodb stop # 默认设置MongoDB是随Ubuntu启动自动启动的。 输入如下命令查看是否启动成功: pgrep mongo -l
修改/etc/mongodb.conf文件, 将auth=true前面的#号去掉,开启动用户权限认证shell
进入mongo,添加帐号密码数据库
use admin //用admin身份 ubuntu
db.createUser({user:"guoke",pwd:"55",roles:["root"]})//建立帐号 vim
db.auth("guoke","55")//就能够进入了 socket
建立帐号以后,若是没有登陆而使用,则会报错,只有先登陆后才能够使用ionic
ubuntu16.04经过apt-get方式安装MongoDB
Ubuntu 16.04 LTS 安装Mongodb 3.4
官网:https://www.mongodb.com/download-center/community
官网教程:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
虽然Ubuntu自己也提供MongoDB安装包,但每每官网的安装包版本更新
1.导入包管理系统使用的公钥
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
2.为MongoDB建立一个列表文件
根据版本建立/etc/apt/sources.list.d/mongodb-org-3.4.list 列表文件
Ubuntu14.04:
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
Ubuntu16.04:
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
Ubuntu18.04:
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
3.更新本地包数据库
sudo apt-get update
4.安装最新版本的MongoDB
sudo apt-get install -y mongodb-org
或者安装特定版本的 MongoDB(必须单独指定每一个组件包以及版本号)
sudo apt-get install -y mongodb-org=4.0.6 mongodb-org-server=4.0.6 mongodb-org-shell=4.0.6 mongodb-org-mongos=4.0.6 mongodb-org-tools=4.0.6
问题:
Failed to start mongodb.service: Unit mongodb.service is masked.
解决方案:
参考连接:http://club.verimake.com/topics/36
The latest version of MongoDB does most of needs except one thing for now. After installing MongoDB on Ubuntu 16.04.x then run the commands as follows:
First create mongodb.service
file by follow command :(只能用vim,gedit打不开这个文件)
sudo vim /etc/systemd/system/mongodb.service
将下面内容粘贴进mongodb.service,而后使用wq退出vim
[Unit] Description=High-performance, schema-free document-oriented database After=network.target [Service] User=mongodb ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf [Install] WantedBy=multi-user.target
Then , run these commands on the terminal one by one:
sudo systemctl enable mongod.service sudo systemctl daemon-reload sudo service mongod start
https://studio3t.com/download/
下载直接next安装便可
进去以后 新建Connect -- 新建数据库 -- 新建Collections
db.getCollection("h6vmovie").find({'page_url':'http://www.hao6v.com/dy/2018-04-23/MouShaQiong.html'}) db.h6vmovie.getIndexes() db.h6vmovie.dropIndex("name_1_year_1") db.h6vmovie.dropIndex("name.local_1_name.str_1_year_1") db.h6vmovie.createIndex({'name.local':1, 'name.str':1, year:1},{unique:true}) db.h6vmovie.createIndex({name:1, year:1, page_url:1},{unique:true}) db.getCollection("h6vmovie").find({"name.local": "en"})
db.getCollection("h6vmovie").find({},{name:1, download_url:1})
db.getCollection("h6vmovie").update({'page_url':'http://www.hao6v.com/jddy/2017-08-16/MuYeChuanQi.html'},{$set:{'director':['谢宝锐 Baorui Xie']}})
sudo apt-get install mysql-server sudo apt-get install mysql-client sudo apt-get install libmysqlclient-dev 检查是否成功:sudo netstat -tap | grep mysql 若是看到有mysql 的socket处于 listen 状态则表示安装成功。
参考连接: Ubuntu Navicat的安装配置