1 Download and Unzip
-zxvf mongodb-linux-x86_64-ubuntu1604-3.4.0.tgz
2 Moving the installation files
sudo mv mongodb-linux-x86_64-ubuntu1604-3.4.0 /usr/local/mongodb
3 Adding environment variables
/etc/profile最后一行添加export PATH=/usr/local/mongodb/bin/etc/profile查看环境变量echo $PATH
4 Adding a configuration file
sudo vim/etc/Mongod.conf#详细记录输出Verbose=True#指定服务器端口号, default port 27017Port= 27017#指定MongoDB日志文件, note that the specified file is not a directoryLogPath= /Var/Log/Mongodb/Mongodb.log#追加形式写日志Logappend=True#指定数据库路径DBPath= /Var/Lib/Mongodb/Db#设定数据库单独路径Directoryperdb=True#启用验证Auth=False#以守护进程的方式运行Fork=True#安静退出Quiet=True
5 Creating a catalog file
/var/log/mongodb/ #创建目录/var/lib/mongodb/-p #创建目录/var/log/mongodb/mongodb.log #创建文件
6 Editing a file under Startup
sudo vim/etc/Init.d/Mongodb#执行的脚本#!/bin/sh# # # BEGIN INIT INFO# Provides:mongodb# Required-start:# Required-stop:# Default-start:2 3 4 5# default-stop:0 1 6# Short-description:mongodb# Description:mongo DB Server# # # END INIT INFO./Lib/Lsb/Init-Functionsprogram=/Usr/Local/Mongodb/bin/Mongodmongopid=' PS-Ef|Grep' Mongod ' |Grep-V grep|Awk' {print $} '' Test-X $PROGRAM||Exit0Case"$" inchStart) Ulimit-N theLog_begin_msg"Starting MongoDB server"$PROGRAM-F/etc/Mongod.conf log_end_msg0 ;;Stop) log_begin_msg"Stopping MongoDB server" if[! -Z"$MONGOPID"];Then kill- the$MONGOPID fi log_end_msg0 ;;Status;; *) log_success_msg"Usage:/etc/init.d/mongodb {start|stop|status}"Exit1Esacexit0
7 Modify permissions and Updates
+/etc/init.d/mongodb sudo update-
8 MongoDB start-up and shutdown
sudo service mongodb startsudo service mongodb stop
Python 3.6 Installation Installation python3.6
sudo apt-get updatesudo apt-get install software-properties-commonsudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-get updatesudo apt-get install python3.6/usr/bin|-s python3.6m pythonsudo apt-get install python3-----version
MySQL Installation installation
sudo apt-get install mysql---p 登录数据库
Open the root user's full name access rights
set host="%"=‘root‘all*.*‘root‘@‘%‘‘密码‘flush privilegesquit
modifying IP bindings for mysql.conf
/etc/mysql/mysql.conf.d/mysqld.cnf将bind-=127.0.0.1修改为bind-=0.0.0.0保存退出
Restart and shutdown
sudo service mysql start 启动sudo service mysql stop 关闭sudo service mysql restart 重启
Installation of Mongodb/python3.6/mysql