Installation of Mongodb/python3.6/mysql

Source: Internet
Author: User
Tags mongodb server

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.