How to Install MySQL 8.0 on Debian 9 Stretch

New photo by WuNan Lin / Google Photos

Mysql 8.0 在台灣時間 2018/04/19 GA 了,可以參考一下 Release Note

目前在 Debian 版本釋出的 Mysql-server 版本在 8.0.11-1debian9

root@mysql8-test:~# dpkg -l | grep mysql-server
ii  mysql-server                          8.0.11-1debian9                amd64        MySQL Server meta package depending on latest version

簡單說明一下怎麼安裝進常用的作業系統上

先把相依性套件 libaio1 裝完

root@mysql8-test:~# apt install libaio1
skip.
Preparing to unpack .../libaio1_0.3.110-3_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-3) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up libaio1:amd64 (0.3.110-3) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...

Download MySQL APT Repository (mysql-apt-config_0.8.10-1_all.deb) && Install

root@mysql8-test:~# dpkg -i mysql-apt-config_0.8.10-1_all.deb
(Reading database ... 32152 files and directories currently installed.)
Preparing to unpack mysql-apt-config_0.8.10-1_all.deb ...
Unpacking mysql-apt-config (0.8.10-1) over (0.8.10-1) ...
Setting up mysql-apt-config (0.8.10-1) ...
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)
OK

Update APT Repository

root@mysql8-test:~# apt update

開始裝 Mysql-server

root@mysql8-test:~# apt install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libmecab2 libnuma1 libperl5.24 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-server mysql-community-server-core perl perl-modules-5.24 psmisc rename
Suggested packages:
  perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl make
The following NEW packages will be installed:
  libmecab2 libnuma1 libperl5.24 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-server mysql-community-server-core mysql-server perl perl-modules-5.24 psmisc rename
0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
Need to get 60.3 MB of archives.
After this operation, 452 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org stretch/updates/main amd64 perl-modules-5.24 all 5.24.1-3+deb9u3 [2,723 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libmecab2 amd64 0.996-3.1 [256 kB]
Get:3 http://repo.mysql.com/apt/debian stretch/mysql-8.0 amd64 mysql-common amd64 8.0.11-1debian9 [78.6 kB]
Get:4 http://deb.debian.org/debian stretch/main amd64 libnuma1 amd64 2.0.11-2.1 [33.3 kB]
Get:5 http://deb.debian.org/debian stretch/main amd64 psmisc amd64 22.21-2.1+b2 [123 kB]
Get:6 http://deb.debian.org/debian stretch/main amd64 mecab-utils amd64 0.996-3.1 [7,364 B]
Get:7 http://deb.debian.org/debian stretch/main amd64 rename all 0.20-4 [12.5 kB]
Get:8 http://deb.debian.org/debian stretch/main amd64 mecab-ipadic all 2.7.0-20070801+main-1 [12.1 MB]
Get:9 http://repo.mysql.com/apt/debian stretch/mysql-8.0 amd64 mysql-community-client-core amd64 8.0.11-1debian9 [1,426 kB]
Get:10 http://security.debian.org stretch/updates/main amd64 libperl5.24 amd64 5.24.1-3+deb9u3 [3,527 kB]
Get:11 http://security.debian.org stretch/updates/main amd64 perl amd64 5.24.1-3+deb9u3 [219 kB]
Get:12 http://repo.mysql.com/apt/debian stretch/mysql-8.0 amd64 mysql-community-client amd64 8.0.11-1debian9 [2,284 kB]
Get:13 http://deb.debian.org/debian stretch/main amd64 mecab-ipadic-utf8 all 2.7.0-20070801+main-1 [4,262 B]
Get:14 http://repo.mysql.com/apt/debian stretch/mysql-8.0 amd64 mysql-client amd64 8.0.11-1debian9 [75.7 kB]
Get:15 http://repo.mysql.com/apt/debian stretch/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.11-1debian9 [16.8 MB]
Get:16 http://repo.mysql.com/apt/debian stretch/mysql-8.0 amd64 mysql-community-server amd64 8.0.11-1debian9 [20.5 MB]
Get:17 http://repo.mysql.com/apt/debian stretch/mysql-8.0 amd64 mysql-server amd64 8.0.11-1debian9 [75.6 kB]
Fetched 60.3 MB in 30s (1,988 kB/s)
skip.
update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-community-server (8.0.11-1debian9) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Setting up mysql-server (8.0.11-1debian9) ...
Processing triggers for systemd (232-25+deb9u3) ...

安裝圖中先指定 Mysql Server 版本

New photo by WuNan Lin / Google Photos

如果要選擇其他版本也可以

New photo by WuNan Lin / Google Photos

安裝過程需要輸入 root 密碼, 跟 mysql 5.7 時期又不一樣了

New photo by WuNan Lin / Google Photos
New photo by WuNan Lin / Google Photos

選用加密方式,預設就好

New photo by WuNan Lin / Google Photos

接著就可以開心的登入使用了

New photo by WuNan Lin / Google Photos

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *