1.将MYSQL APT仓库添加到系统仓库列表中,可以通过安装MYSQL提供的.deb文件来执行
2.使用以下命令安装下载的发行包,并将名称改为下载的APT包的平台和特定版本
dpkg -i mysql-apt-config_0.8.13-1_all.deb
3.在安装包的过程中你需要选择MYSQL服务器和其他组件的版本
如果想更改发行版本,执行以下操作
dpkg-reconfigure mysql-apt-config
4.使用以下命令从MYSQL APT仓库更新包信息
root@ebs-26932:~# apt-get update
Get:1 http://repo.mysql.com/apt/ubuntu bionic InRelease [19.4 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 Sources [938 B]
Get:4 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:5 http://repo.mysql.com/apt/ubuntu bionic/mysql-apt-config amd64 Packages [564 B]
Get:6 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 Packages [7,144 B]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-tools amd64 Packages [4,247 B]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [353 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-security/main Translation-en [125 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [618 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [229 kB]
Fetched 1,535 kB in 5s (305 kB/s)
Reading package lists… Done
5.安装MYSQL,在安装过程中,你需要为MYSQL的root用户设置密码
6.验证包
root@ebs-26932:~# dpkg -l | grep -i mysql
ii mysql-apt-config 0.8.13-1 all Auto configuration for MySQL APT Repo.
ii mysql-client 8.0.16-2ubuntu18.04 amd64 MySQL Client meta package depending on latest version
ii mysql-common 8.0.16-2ubuntu18.04 amd64 Common files shared between packages
ii mysql-community-client 8.0.16-2ubuntu18.04 amd64 MySQL Client
ii mysql-community-client-core 8.0.16-2ubuntu18.04 amd64 MySQL Client Core Binaries
ii mysql-community-server 8.0.16-2ubuntu18.04 amd64 MySQL Server
ii mysql-community-server-core 8.0.16-2ubuntu18.04 amd64 MySQL Server Core Binaires