1.登录MySQL官网,选择需要的版本:https://dev.mysql.com/downloads/mysql/
2.下载mysql-server_5.7.32-1ubuntu16.04_amd64.deb-bundle.tar (我本的系统是ubuntu16.04,项目要求安装mysql5.7)
3.解压
$ tar -xvf mysql-server_5.7.32-1ubuntu16.04_amd64.deb-bundle.tar
得到以下文件
4.下载mysql的依赖
a.登录https://pkgs.org/download/libaio1,下载 libaio1_0.3.110-2_amd64.deb
b.登录https://www.ubuntuupdates.org/pm/libmecab2,下载libmecab2_0.996-1.2ubuntu1_amd64.deb
c.登录https://ubuntu.pkgs.org/16.04/ubuntu-main-amd64/psmisc_22.21-2.1build1_amd64.deb.html,下载psmisc_22.21-2.1build1_amd64.deb
5.安装
a.先安装依赖
$ dpkg -i libaio1_0.3.110-2_amd64.deb
$ dpkg -i libmecab2_0.996-1.2ubuntu1_amd64.deb
$ dpkg -i psmisc_22.21-2.1build1_amd64.deb
b.从上往下顺序安装mysql解压出来的包
$ dpkg -i mysql-common_5.7.32-1ubuntu16.04_amd64.deb
$ dpkg -i mysql-community-client_5.7.32-1ubuntu16.04_amd64.deb
$ dpkg -i mysql-client_5.7.32-1ubuntu16.04_amd64.deb
$ dpkg -i mysql-community-server_5.7.32-1ubuntu16.04_amd64.deb
$ dpkg -i mysql-server_5.7.32-1ubuntu16.04_amd64.deb
$ dpkg -i libmysqlclient20_5.7.32-1ubuntu16.04_amd64.deb
$ dpkg -i libmysqlclient-dev_5.7.32-1ubuntu16.04_amd64.deb
$ dpkg -i libmysqld-dev_5.7.32-1ubuntu16.04_amd64.deb
6.查看版本
$ mysql --version
7.登录
$ mysql -u 用户名 –p
Enter password:[输入设定的初始密码]