#安装python需要的编译包
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel gcc
#下载python在线源压缩包
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
#导入配置文件
mkdir ~/.pip/
cat > ~/.pip/pip.conf <<EOF
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
EOF
#编译安装
yum -y install libffi-devel zlib* python-devel openssl-devel
tar -zxf Python-3.9.0.tgz
cd Python-3.9.0/./configure --prefix=/usr/local/python --with-ssl
make && make install
#加入环境变量
ln -s /usr/local/python/bin/python3 /usr/bin/echo ‘export PATH=/usr/local/python/bin:$PATH’ >> /etc/profile
source /etc/profile
#安装mycli工具
pip3 install mycli
#使用mycli登录数据库echo “输入:mycli -uroot -p+数据库密码进入mycli工具”