CentOS 7升級Python3,然後安裝Mycli
發表時間:2020-10-19
發布人:葵宇科技
浏覽次數:57
0.查看系統版本
cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
1.配置阿裡pip倉庫
mkdir ~/.pip/
cat > ~/.pip/pip.conf <<EOF
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
EOF
2.升級python
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
3.創建鍊接,提升易用性
ln -s /usr/local/python/bin/python3 /usr/bin/
sed -i '/^PATH/s#$#:/usr/local/python/bin#' ~/.bash_profile
source ~/.bash_profile
echo $PATH
4.安裝、啟動(dòng)mycli
pip3 install mycli
systemctl status mariadb
mycli
# 運行mycli報錯的話可(kě)以改一下(xià)執行器(qì)
# sed -i 's/python/python3/' /usr/bin/mycli