1 下载安装包
我下载的如下版本:
2 解压安装包
tar -xvf mysql-server_5.7.34-1ubuntu18.04_amd64.deb-bundle.tar
解压如下图,红色表示解压出来的内容:
3 安装lib系列
sudo apt-get install ./libmysql*
4 安装libtinfo5
sudo apt-get install libtinfo5
5按顺序执行下列命令即可
sudo apt-get install ./mysql-common_5.7.34-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-client_5.7.34-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-community-server_5.7.34-1ubuntu18.04_amd64.deb
sudo apt-get install ./mysql-server_5.7.34-1ubuntu18.04_amd64.deb
执行结果:
6 遇到的问题
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3792 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
解决方案,红色标出来的,先通过ps 将对应的进程找到,在通过kill杀掉进程
7 安装完成
mysql -uroot -p