第一步、安装相关依赖软件(需要配置yum官方或者阿里源进行安装)
cd /etc/yum.repo.d/repos.bak
mv * ..
yum -y install epel-release
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 包 直接拖进去就可以了 顺便解压一下
cd /opt
tar -zxvf Python-3.9.0.tgz
第三步、安装相关依赖软件,并进行编译安装
yum -y install libffi-devel zlib* python-devel openssl-devel
cd Python-3.9.0/
./configure --prefix=/usr/local/python --with-ssl
make && make install
第四步、优化路径,安装pip3
ln -s /usr/local/python/bin/python3 /usr/bin/
echo 'export PATH=/usr/local/python/bin:$PATH' >> /etc/profile
source /etc/profile
pip3 install mycli
第五步、登录
mycli -u root -p <密码> #mycli -u root -p 88888888
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/7b3473f3e4d77b1323cbeaaade111096.png#pic_center)