===========================
centos7.3安装mysql
前期工作
cd /home
mkdir liuxiawei
cd liuxiawei
mkdir server
mkdir tools
cd tools
1.检测是否已经安装mysql服务
rpm -qa | grep mysql
2.下载mysql包
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
- 安装 mysql57-community-release-el7-8.noarch.rpm:
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
4.下载安装mysql
yum install mysql-server
5.启动mysql服务
service mysqld start
6.查看随机密码
grep "password" /var/log/mysqld.log
2019-05-14T02:17:16.818716Z 1 [Note] A temporary password is generated for root@localhost: Eal>tvRy(8?n
7.进入mysql命令模式修改密码
mysql -uroot -"Eal>tvRy(8?n"
8.使用随机密码连接mysql
/usr/bin/mysql -u root -p
Eal>tvRy(8?n
9.修改密码
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('XXX');
如果出现这个错误:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
那是因为密码设置得太简单了
10.停止服务
service mysqld stop
11.设置mysql远程连接
mysql -u root -p
mysql>use mysql;
mysql>select 'host' from user where user='root';
mysql>update user set host = '%' where user ='root';
mysql>flush privileges;
==============================
centos7.3安装python3.8
前期准备
cd /home/tools
1.下载python官方tgz包并FTP到tools下
https://www.python.org/downloads/release/python-380/
2.YUM安装编译Python所需要的开发包
yum -y install gcc zlib* libffi-devel
3.解压tar包
tar -xvf Python-3.8.0.tgz
cd Python-3.8.0
./configure --prefix=/usr/local/bin/python3
make
make install
- //查看系统默认Python的版本号
python -V
rm -rf /usr/bin/python
ln -s /usr/local/bin/python3/bin/python3 /usr/bin/python
python -V
yum update
vi /usr/bin/yum
把#!/usr/bin/python
改成#!/usr/bin/python2.7
vi /usr/libexec/urlgrabber-ext-down
把#!/usr/bin/python
改成#!/usr/bin/python2.7
15.这里不要选择更新,否则python版本会变回2
yum update
16.pip3加入环境变量
#vim ~/.bash_profile
#.bash_profile
#Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
#User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/python3/bin
export PATH
source ~/.bash_profile(环境变量生效)
============================
运行app.py
cd 项目名
vim start.sh(创建执行脚本,&切记)
sudo nohup python app.py &
chmod 777 start.sh
./start.sh