MySQL 8 Cookbook
上QQ阅读APP看书,第一时间看更新

Using APT repositories

  1. Add the MySQL APT repository to your system's repository list. This is a one-time operation that can be performed by installing a .deb file provided by MySQL
    You can download the MySQL APT repository from http://dev.mysql.com/downloads/repo/apt/.
    Or you can copy the link location and use wget to download directly on to the server. You might need to install wget (sudo apt-get install wget):
shell> wget "https://repo.mysql.com//mysql-apt-config_0.8.9-1_all.deb"
  1. Install the downloaded release package with the following command, replacing  the name with platform- and version-specific package name of the downloaded APT package:
shell> sudo dpkg -i mysql-apt-config_0.8.9-1_all.deb 
(Reading database ... 131133 files and directories currently installed.)
Preparing to unpack mysql-apt-config_0.8.9-1_all.deb ...
Unpacking mysql-apt-config (0.8.9-1) over (0.8.9-1) ...
Setting up mysql-apt-config (0.8.9-1) ...
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)
OK
  1. During the installation of the package, you will be asked to choose the versions of the MySQL server and other components. Press Enter for selecting and the Up and Down keys for navigating.
    Select MySQL Server and Cluster (Currently selected: mysql-5.7).
    Select mysql-8.0 preview (At the time of writing, MySQL 8.0 is not GA). You might get a warning such as MySQL 8.0-RC Note that MySQL 8.0 is currently an RC. It should only be installed to preview upcoming features of MySQL, and is not recommended for use in production environments(RC is short for release candidate).
    If you want to change the release version, execute the following:
shell> sudo dpkg-reconfigure mysql-apt-config
  1. Update package information from the MySQL APT repository with the following command (this step is mandatory):
shell> sudo apt-get update
  1. Install MySQL. During installation, you'll need to provide a password for the root user for your MySQL installation. Remember the password; if you forget it, you'll have to reset the root password (refer to the Resetting root password section). This installs the package for the MySQL server, as well as the packages for the client and for the database common files:
shell> sudo apt-get install -y mysql-community-server
~
Processing triggers for ureadahead (0.100.0-19) ...
Setting up mysql-common (8.0.3-rc-1ubuntu14.04) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up mysql-community-client-core (8.0.3-rc-1ubuntu14.04) ...
Setting up mysql-community-server-core (8.0.3-rc-1ubuntu14.04) ...
~
  1. Verify packages. ii indicates that the package is installed:
shell> dpkg -l | grep -i mysql
ii mysql-apt-config 0.8.9-1 all Auto configuration for MySQL APT Repo.
ii mysql-client 8.0.3-rc-1ubuntu14.04 amd64 MySQL Client meta package depending on latest version
ii mysql-common 8.0.3-rc-1ubuntu14.04 amd64 MySQL Common
ii mysql-community-client 8.0.3-rc-1ubuntu14.04 amd64 MySQL Client
ii mysql-community-client-core 8.0.3-rc-1ubuntu14.04 amd64 MySQL Client Core Binaries
ii mysql-community-server 8.0.3-rc-1ubuntu14.04 amd64 MySQL Server
ii mysql-community-server-core 8.0.3-rc-1ubuntu14.04 amd64 MySQL Server Core Binaires