方法一、直接下载二进制文件

1
2
yum install -y ncurses-libs # 这个包centos默认自带了
curl -OL https://file.babudiu.com/f/w0ty/mysql && chmod +x mysql
1
2
apt install -y libncurses5
curl -OL https://file.babudiu.com/f/w0ty/mysql && chmod +x mysql

方法二、使用源安装

1
yum install -y ncurses-libs mariadb-client
1
2
3
4
sed -i 's@//.*debian.org@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list
sed -i 's@//.*ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list

apt update && apt install -y libncurses5 mariadb-client