python3.6.2+django1.11+mysql環境インストール
1240 ワード
#
echo 'LANG="en_GB.utf8"' > /etc/sysconfig/i18n
LANG="en_GB.utf8"
#
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOSBase.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# python
yum -y install openssl-devel readline-devel unzip
# python3.6.2
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
#
tar -xzf Python-3.6.2.tgz
cd Python-3.6.2
./configure --prefix=/usr/local/python36
make
make install
# pip
tee /etc/pip.conf <=1.11" ## django 1.11
pip install ipython ## ipython
# env
deactivate
# mysql
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum install -y mysql mysql-server mysql-devel zlib-devel
source ~/Desktop/env/bin/activate
pip install pymysql
## my.cnf
vim /etc/my.cnf
[mysqld]
default-storage-engine = innodb
innodb_file_per_tablecollation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
#
service mysqld start
#mysql
mysql_secure_installation
# django
mysql -uroot -pxxxx -e "create database django CHARACTER SET utf8;