阿里云 Ubuntu18.0 安装 MySQL 8+
-
登录Linux服务器终端。
-
更新软件源并安装wget。
sudo apt update
sudo apt install wget
- 下载MySQL数据库安装包。
wget https://dev.mysql.com/get/mysql-apt-config_0.8.16-1_all.deb
说明 如果没有安装wget,需要先执行apt install wget安装wget。
- 使用deb包更新软件源。
sudo dpkg -i mysql-apt-config_0.8.16-1_all.deb
在弹出的对话框中选择MySQL Server & Cluster (Currently selected: mysql-8.0),然后选择Ok。
提示信息:
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)
OK
- 从 MySQL APT 仓库更新包信息:
sudo apt update
sudo apt-cache policy mysql-server
- 或者使用提示有错使用这个更新
$ sudo apt-get update
提示信息
Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease
Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed InRelease [242 kB]
Get:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main amd64 DEP-11 Metadata [38.5 kB]
Get:7 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main DEP-11 48x48 Icons [17.6 kB]
Get:8 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main DEP-11 64x64 Icons [41.5 kB]
Get:9 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe amd64 DEP-11 Metadata [42.1 kB]
Get:10 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe DEP-11 48x48 Icons [16.4 kB]
Get:11 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe DEP-11 64x64 Icons [111 kB]
Get:12 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:13 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 DEP-11 Metadata [294 kB]
Get:14 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main DEP-11 48x48 Icons [73.8 kB]
Get:15 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main DEP-11 64x64 Icons [140 kB]
Get:16 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [264 kB]
Get:17 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe DEP-11 48x48 Icons [197 kB]
Get:18 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe DEP-11 64x64 Icons [445 kB]
Get:19 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:20 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [8,280 B]
Get:21 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed/main amd64 DEP-11 Metadata [20.4 kB]
Get:22 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed/main DEP-11 64x64 Icons [11.0 kB]
Get:23 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed/universe amd64 DEP-11 Metadata [11.7 kB]
Hit:24 http://mirrors.aliyun.com/ubuntu bionic InRelease
Get:25 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB]
Get:26 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:27 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:28 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB]
Get:29 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [38.5 kB]
Get:30 http://mirrors.aliyun.com/ubuntu bionic-security/main DEP-11 48x48 Icons [17.6 kB]
Get:31 http://mirrors.aliyun.com/ubuntu bionic-security/main DEP-11 64x64 Icons [41.5 kB]
Get:32 http://mirrors.aliyun.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [42.1 kB]
Get:33 http://mirrors.aliyun.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [16.4 kB]
Get:34 http://mirrors.aliyun.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [111 kB]
Get:35 http://mirrors.aliyun.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:36 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [294 kB]
Get:37 http://mirrors.aliyun.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [73.8 kB]
Get:38 http://mirrors.aliyun.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [140 kB]
Get:39 http://mirrors.aliyun.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [264 kB]
Get:40 http://mirrors.aliyun.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [208 kB]
Get:41 http://mirrors.aliyun.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [456 kB]
Get:42 http://mirrors.aliyun.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:43 http://mirrors.aliyun.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [8,284 B]
Get:44 http://mirrors.aliyun.com/ubuntu bionic-proposed/main amd64 DEP-11 Metadata [20.5 kB]
Get:45 http://mirrors.aliyun.com/ubuntu bionic-proposed/universe amd64 DEP-11 Metadata [11.7 kB]
Get:46 http://mirrors.aliyun.com/ubuntu bionic-proposed/universe DEP-11 64x64 Icons [10.8 kB]
Get:47 http://repo.mysql.com/apt/ubuntu bionic InRelease [19.4 kB]
Get:47 http://repo.mysql.com/apt/ubuntu bionic InRelease [19.4 kB]
Get:48 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 Sources [948 B]
Get:49 http://repo.mysql.com/apt/ubuntu bionic/mysql-apt-config amd64 Packages [566 B]
Get:50 http://repo.mysql.com/apt/ubuntu bionic/mysql-apt-config i386 Packages [566 B]
Get:51 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 Packages [7,570 B]
Get:52 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 i386 Packages [7,620 B]
Get:53 http://repo.mysql.com/apt/ubuntu bionic/mysql-tools amd64 Packages [4,294 B]
Get:54 http://repo.mysql.com/apt/ubuntu bionic/mysql-tools i386 Packages [3,694 B]
Fetched 4,519 kB in 53s (84.8 kB/s)
Reading package lists... Done
使用 APT 安装 MySQL
$ sudo apt-get install mysql-server
提示
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libmecab2 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
The following NEW packages will be installed:
libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-community-client
mysql-community-client-core mysql-community-server mysql-community-server-core mysql-server
The following packages will be upgraded:
mysql-common
1 upgraded, 10 newly installed, 0 to remove and 95 not upgraded.
Need to get 35.3 MB of archives.
After this operation, 255 MB of additional disk space will be used.
Do you want to continue? [Y/n]
- 输入Y继续
Do you want to continue? [Y/n] y
Get:1 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-common amd64 8.0.19-1ubuntu18.04 [94.6 kB]
Get:2 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 libmecab2 amd64 0.996-5 [257 kB]
Get:3 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 mecab-utils amd64 0.996-5 [4,856 B]
Get:4 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 mecab-ipadic all 2.7.0-20070801+main-1 [12.1 MB]
Get:5 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 mecab-ipadic-utf8 all 2.7.0-20070801+main-1 [3,522 B]
Get:6 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client-core amd64 8.0.19-1ubuntu18.04 [1,684 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.19-1ubuntu18.04 [2,825 kB]
Get:8 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-client amd64 8.0.19-1ubuntu18.04 [91.1 kB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
Err:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04
Connection failed [IP: 2.22.77.13 80]
Get:10 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server amd64 8.0.19-1ubuntu18.04 [102 kB]
Get:10 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server amd64 8.0.19-1ubuntu18.04 [102 kB]
Get:11 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-server amd64 8.0.19-1ubuntu18.04 [91.1 kB]
Get:11 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-server amd64 8.0.19-1ubuntu18.04 [91.1 kB]
Fetched 14.5 MB in 1h 2min 41s (3,855 B/s)
E: Failed to fetch http://repo.mysql.com/apt/ubuntu/pool/mysql-8.0/m/mysql-community/mysql-community-server-core_8.0.19-1ubuntu18.04_amd64.deb Connection failed [IP: 2.22.77.13 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
安装失败,按照提示,重新更新一次:
- 执行
$ sudo apt-get update
提示:
Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease
Hit:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease
Hit:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease
Hit:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease
Hit:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed InRelease
Hit:6 http://repo.mysql.com/apt/ubuntu bionic InRelease
Hit:7 http://mirrors.aliyun.com/ubuntu bionic InRelease
Hit:8 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
Hit:9 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
Hit:10 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
Hit:11 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
Reading package lists... Done
再次执行安装:
$ sudo apt-get install mysql-server
提示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libmecab2 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
The following NEW packages will be installed:
libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-community-client
mysql-community-client-core mysql-community-server mysql-community-server-core mysql-server
The following packages will be upgraded:
mysql-common
1 upgraded, 10 newly installed, 0 to remove and 95 not upgraded.
Need to get 18.0 MB/35.3 MB of archives.
After this operation, 255 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.19-1ubuntu18.04 [18.0 MB]
81% [1 mysql-community-server-core 10.4 MB/18.0 MB 57%] Fetched 16.8 MB in 1min 47s (157 kB/s)
输入密码:
确认密码:
提示:
选择兼容 5.x 的认证插件:
Preconfiguring packages ...
(Reading database ... 168092 files and directories currently installed.)
Preparing to unpack .../00-mysql-common_8.0.19-1ubuntu18.04_amd64.deb ...
Unpacking mysql-common (8.0.19-1ubuntu18.04) over (5.8+1.0.4) ...
Selecting previously unselected package mysql-community-client-core.
Preparing to unpack .../01-mysql-community-client-core_8.0.19-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-client-core (8.0.19-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-client.
Preparing to unpack .../02-mysql-community-client_8.0.19-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-client (8.0.19-1ubuntu18.04) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../03-mysql-client_8.0.19-1ubuntu18.04_amd64.deb ...
Unpacking mysql-client (8.0.19-1ubuntu18.04) ...
Selecting previously unselected package libmecab2:amd64.
Preparing to unpack .../04-libmecab2_0.996-5_amd64.deb ...
Unpacking libmecab2:amd64 (0.996-5) ...
Selecting previously unselected package mysql-community-server-core.
Preparing to unpack .../05-mysql-community-server-core_8.0.19-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-server-core (8.0.19-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-server.
Preparing to unpack .../06-mysql-community-server_8.0.19-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-server (8.0.19-1ubuntu18.04) ...
Selecting previously unselected package mecab-utils.
Preparing to unpack .../07-mecab-utils_0.996-5_amd64.deb ...
Unpacking mecab-utils (0.996-5) ...
Selecting previously unselected package mecab-ipadic.
Preparing to unpack .../08-mecab-ipadic_2.7.0-20070801+main-1_all.deb ...
Unpacking mecab-ipadic (2.7.0-20070801+main-1) ...
Selecting previously unselected package mecab-ipadic-utf8.
Preparing to unpack .../09-mecab-ipadic-utf8_2.7.0-20070801+main-1_all.deb ...
Unpacking mecab-ipadic-utf8 (2.7.0-20070801+main-1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../10-mysql-server_8.0.19-1ubuntu18.04_amd64.deb ...
Unpacking mysql-server (8.0.19-1ubuntu18.04) ...
Setting up mysql-common (8.0.19-1ubuntu18.04) ...
Configuration file '/etc/mysql/conf.d/mysql.cnf'
==> Deleted (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** mysql.cnf (Y/I/N/O/D/Z) [default=N] ?
- 输入Y继续
*** mysql.cnf (Y/I/N/O/D/Z) [default=N] ? Y
Installing new version of config file /etc/mysql/conf.d/mysql.cnf ...
Configuration file '/etc/mysql/my.cnf.fallback'
==> Deleted (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** my.cnf.fallback (Y/I/N/O/D/Z) [default=N] ?
- 输入Y继续
*** my.cnf.fallback (Y/I/N/O/D/Z) [default=N] ? Y
Installing new version of config file /etc/mysql/my.cnf.fallback ...
update-alternatives: warning: forcing reinstallation of alternative /etc/mysql/my.cnf.fallback because link group my.cnf is broken
Setting up libmecab2:amd64 (0.996-5) ...
Setting up mysql-community-client-core (8.0.19-1ubuntu18.04) ...
Setting up mysql-community-server-core (8.0.19-1ubuntu18.04) ...
Setting up mecab-utils (0.996-5) ...
Setting up mysql-community-client (8.0.19-1ubuntu18.04) ...
Setting up mecab-ipadic (2.7.0-20070801+main-1) ...
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27327
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
update-alternatives: using /var/lib/mecab/dic/ipadic to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-client (8.0.19-1ubuntu18.04) ...
Setting up mecab-ipadic-utf8 (2.7.0-20070801+main-1) ...
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27327
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
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.19-1ubuntu18.04) ...
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.19-1ubuntu18.04) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
- 根据获取到的安装版本安装MySQL5.7,安装过程中需设置root用户密码,请将密码记录并妥善保存。
sudo apt install -f mysql-client=5.7.32-1ubuntu18.04 mysql-community-server=5.7.32-1ubuntu18.04 mysql-server=5.7.32-1ubuntu18.04
配置MySQL数据库。
- 设置常规化安全。
sudo mysql_secure_installation
请根据提示信息设置,如下所示:
Enter current password for root (enter for none): <Enter password>
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: Y
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1
Using existing password for root.
Estimated strength of the password: 25
Change the password for root ? ((Press y|Y for Yes, any other key for No) : d
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
- 开启远程访问。
- 编辑MySQL数据库的配置文件。
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
- 按I键,将bind-address的值修改为0.0.0.0。
- 按Esc键,输入:wq!保存并退出。
- 重启MySQL数据库服务使配置生效。
sudo systemctl restart mysql
- MySQL 服务器在安装完成之后自动启动,我们可以查看 MySQL 服务器的状态:
$ sudo service mysql status
提示:
[sudo] password for mk:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
Active: active (running) since Mon 2020-02-10 15:36:29 CST; 3min 48s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 9376 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=
Main PID: 9415 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 4915)
CGroup: /system.slice/mysql.service
└─9415 /usr/sbin/mysqld
2月 10 15:36:26 mk-Lenovo-Y430P systemd[1]: Starting MySQL Community Server...
2月 10 15:36:29 mk-Lenovo-Y430P systemd[1]: Started MySQL Community Server.
- 通过以下命令停止 MySQL 服务器:
$ sudo service mysql stop
- 通过以下命令启动 MySQL 服务器:
$ sudo service mysql start
- 查看版本信息:
$ mysql --version
mysql Ver 8.0.19 for Linux on x86_64 (MySQL Community Server - GPL)
本文来自博客园,作者:愺様,转载请注明原文链接:https://www.cnblogs.com/wyh0923/p/14900893.html