1、安装相关依赖软件(需要配置yum官方或者阿里源进行安装)
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
2、下载 python 包 直接拖进去就可以了 顺便解压一下
tar -zxvf Python-3.9.0.tgz
3、安装相关依赖软件,并进行编译安装
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
4、优化路径,安装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
5、登录
mycli -u root -p <密码> #mycli -u root -p abc123