ubantu 20 安装mysql5.7.35

这篇博客介绍了如何下载并安装MySQL 5.7.31的历史版本,通过wget命令获取deb包,然后使用tar解压,并删除带test的文件。在安装过程中遇到了依赖问题,如libaio1、perl和libmecab2等未安装。解决方法是运行'apt --fix-broken install'修复依赖。更新alternatives后,my.cnf配置文件自动设置完成。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mysql历史版本
https://downloads.mysql.com/archives/community/

标题是5.7.35,下面的命令是5.7.31,注意一下

wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar
tar -xvf mysql-server_5.7.31-1ubuntu18.04_amd64.deb-bundle.tar
rm -f mysql-testsuite_5.7.31-1ubuntu18.04_amd64.deb
rm -f mysql-community-test_5.7.31-1ubuntu18.04_amd64.deb
dpkg -i mysql-*.deb

删除带test的内容
如果报错,可以按照提示进行处理

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mysql-community-client : Depends: libaio1 (>= 0.3.93) but it is not going to be installed
 mysql-community-server : Depends: perl but it is not going to be installed
                          Depends: libaio1 (>= 0.3.93) but it is not going to be installed
                          Depends: libmecab2 but it is not going to be installed
 mysql-community-test : Depends: mysql-community-server (= 5.7.31-1ubuntu18.04) but 5.7.35-1ubuntu18.04 is to be installed
                        Depends: mysql-community-client (= 5.7.31-1ubuntu18.04) but 5.7.35-1ubuntu18.04 is to be installed
                        Depends: python
                        Depends: libjson-perl but it is not going to be installed
                        Depends: libaio1 (>= 0.3.93) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

直接执行apt --fix-broken install即可

update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值