以下操作可在wsl中进行
- 同步索引信息
- mysql 8
1 | mkdir -p mysql8/repodata |
- mysql 5.7
1
2
3mkdir -p mysql57/repodata
cd mysql57/repodata
lftp "https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7/repodata/" -e "mirror --verbose -P 5 --delete --only-missing; bye"
- 获取最新的版本号
- mysql 8
1 | mysql8_version=$(lftp https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql80-community-el7/ -e "cls;bye" | grep -e "mysql-community-client.*.el7.x86_64.rpm" | sed -r 's/mysql-community-client-(.*).el7.x86_64.rpm/\1/g' | sort -rV | xargs | awk -F ' ' '{print $1}') |
- mysql 5.7
1 | mysql57_version=$(lftp https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7/ -e "cls;bye" | grep -e "mysql-community-client.*.el7.x86_64.rpm" | sed -r 's/mysql-community-client-(.*).el7.x86_64.rpm/\1/g' | sort -rV | xargs | awk -F ' ' '{print $1}') |