依然是熟悉是Ubuntu 20.04,如何安装MySQL 5.7版本呢?那别为为啥不装更新的,测试环境尽量和现网保持一致。
Ubuntu 20.04 安装MySQL 5.7 方法如下:
cp /etc/apt/sources.list /etc/apt/sources.list.old
cat <<EOF > /etc/apt/sources.list
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
EOF
apt-get update -y
apt-get install mysql-server-5.7 mysql-client-5.7 mysql-client-core-5.7 libtinfo5 -y
那基本上就是切换到清华的源然后指定版本安装数据库。
按提示输入相关信息以及MySQL的root密码,之后就装好MySQL。
安装过程中会卸载ncurses,莫慌~
全部安装结束后:
cp /etc/apt/sources.list.old /etc/apt/sources.list
apt-get update -y
apt install ncurses-base
恢复软件源并装回ncurses,万事大吉。
参考资料
Ubuntu 20.04 安装和配置MySql5.7的详细教程
Ubuntu 20.04 切换 阿里源方法
Ubuntu ‘xterm’: unknown terminal type 报错信息解决方案
如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。
如本文对您有用,捐赠和留言 将是对我最好的支持~(捐赠可转为站内积分)
如愿意,请向朋友推荐本站,谢谢。
尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。