Centos 8 环境配置

本文最后更新于:6 个月前

一、Centos 8 环境配置

http://8.140.195.191/

http://8.140.195.191/NavigationPage/

1. 安装NGINX

参考:Nginx配置文件详解

(1) 配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#全局块
#user nobody;
worker_processes 1;

#event块
events {
worker_connections 1024;
}

#http块
http {
#http全局块
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
#server块
server {
#server全局块
listen 8000;
server_name localhost;
#location块,根路径使用root
location / {
root html;
index index.html index.htm;
}
# 非根路径使用alias
location /test {
# 路径配置
alias /home/dev/NavigationPage;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#这边可以有多个server块
server {
...
}
}

(2) 基本命令

1
2
3
systemctl start/stop/restart/status nginx
# 重新加载nginx的配置文件
sudo systemctl reload nginx

(3) 关闭防火墙

1
systemctl stop firewalld

2. 解压缩命令

1
unzip -O CP936 xxx.zip

注意:直接使用unzip会出现中文乱码

3. 安装MySQL

参考:centos8安装mysql8.0.22教程(超详细)_centos8中mod_auth_mysql-CSDN博客

(1) 下载安装包

1
2
3
[root@iZ2zeb7ybli3zzdll6airpZ files]# pwd
/home/files
[root@iZ2zeb7ybli3zzdll6airpZ files]# wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm

(2) 安装

1
[root@iZ2zeb7ybli3zzdll6airpZ files]# yum install mysql80-community-release-el8-1.noarch.rpm

(3) 检查数据源,查看mysql源是否安装成功

1
2
3
4
5
[root@iZ2zeb7ybli3zzdll6airpZ files]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community MySQL Connectors Community
mysql-tools-community MySQL Tools Community
mysql80-community MySQL 8.0 Community Server

(4) 安装(核心)

1
2
3
4
5
6
7
[root@iZ2zeb7ybli3zzdll6airpZ files]# yum install mysql-community-server
MySQL 8.0 Community Server 400 kB/s | 3.4 MB 00:08
MySQL Connectors Community 36 kB/s | 110 kB 00:03
MySQL Tools Community 215 kB/s | 872 kB 00:04
上次元数据过期检查:0:00:02 前,执行于 2024年01月10日 星期三 23时00分55秒。
所有的匹配结果均已经被参数的模块化过滤条件筛除: mysql-community-server
错误:没有任何匹配: mysql-community-server

① 禁用CentOS8自带mysql模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@iZ2zeb7ybli3zzdll6airpZ files]# yum module disable mysql
上次元数据过期检查:0:02:38 前,执行于 2024年01月10日 星期三 23时00分55秒。
依赖关系解决。
============================================================================================================================================================
软件包 架构 版本 仓库 大小
============================================================================================================================================================
禁用模块:
mysql

事务概要
============================================================================================================================================================

确定吗?[y/N]: y
完毕!
[root@iZ2zeb7ybli3zzdll6airpZ files]#

② 安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[root@iZ2zeb7ybli3zzdll6airpZ files]# yum install mysql-community-server
上次元数据过期检查:0:03:14 前,执行于 20240110日 星期三 230055秒。
依赖关系解决。
============================================================================================================================================================
软件包 架构 版本 仓库 大小
============================================================================================================================================================
安装:
mysql-community-server x86_64 8.0.35-1.el8 mysql80-community 64 M
安装依赖关系:
mysql-community-client x86_64 8.0.35-1.el8 mysql80-community 16 M
mysql-community-client-plugins x86_64 8.0.35-1.el8 mysql80-community 3.6 M
mysql-community-common x86_64 8.0.35-1.el8 mysql80-community 668 k
mysql-community-icu-data-files x86_64 8.0.35-1.el8 mysql80-community 2.2 M
mysql-community-libs x86_64 8.0.35-1.el8 mysql80-community 1.5 M

事务概要
============================================================================================================================================================
安装 6 软件包

总下载:88 M
安装大小:415 M
确定吗?[y/N]: y
下载软件包:
(1/6): mysql-community-common-8.0.35-1.el8.x86_64.rpm 211 kB/s | 668 kB 00:03
(2/6): mysql-community-client-plugins-8.0.35-1.el8.x86_64.rpm 732 kB/s | 3.6 MB 00:04
(3/6): mysql-community-icu-data-files-8.0.35-1.el8.x86_64.rpm 847 kB/s | 2.2 MB 00:02
(4/6): mysql-community-libs-8.0.35-1.el8.x86_64.rpm 886 kB/s | 1.5 MB 00:01
(5/6): mysql-community-client-8.0.35-1.el8.x86_64.rpm 1.5 MB/s | 16 MB 00:10
[MIRROR] mysql-community-server-8.0.35-1.el8.x86_64.rpm: Curl error (28): Timeout was reached for http://repo.mysql.com/yum/mysql-8.0-community/el/8/x86_64/mysql-community-server-8.0.35-1.el8.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
(6/6): mysql-community-server-8.0.35-1.el8.x86_64.rpm 521 kB/s | 64 MB 02:06
------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 682 kB/s | 88 MB 02:12
警告:/var/cache/dnf/mysql80-community-b1f1ed5ba88ce0f8/packages/mysql-community-client-8.0.35-1.el8.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
MySQL 8.0 Community Server 27 MB/s | 27 kB 00:00
导入 GPG 公钥 0x5072E1F5:
Userid: "MySQL Release Engineering <mysql-build@oss.oracle.com>"
指纹: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5
来自: /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
确定吗?[y/N]: y
导入公钥成功
导入的密钥没有公钥,错误的公钥?
mysql-community-client-8.0.35-1.el8.x86_64.rpm 的公钥没有安装. 失败的软件包是:mysql-community-client-8.0.35-1.el8.x86_64
GPG密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
mysql-community-client-plugins-8.0.35-1.el8.x86_64.rpm 的公钥没有安装. 失败的软件包是:mysql-community-client-plugins-8.0.35-1.el8.x86_64
GPG密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
mysql-community-common-8.0.35-1.el8.x86_64.rpm 的公钥没有安装. 失败的软件包是:mysql-community-common-8.0.35-1.el8.x86_64
GPG密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
mysql-community-icu-data-files-8.0.35-1.el8.x86_64.rpm 的公钥没有安装. 失败的软件包是:mysql-community-icu-data-files-8.0.35-1.el8.x86_64
GPG密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
mysql-community-libs-8.0.35-1.el8.x86_64.rpm 的公钥没有安装. 失败的软件包是:mysql-community-libs-8.0.35-1.el8.x86_64
GPG密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
mysql-community-server-8.0.35-1.el8.x86_64.rpm 的公钥没有安装. 失败的软件包是:mysql-community-server-8.0.35-1.el8.x86_64
GPG密钥配置为:file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
下载的软件包保存在缓存中,直到下次成功执行事务。
您可以通过执行 'yum clean packages' 删除软件包缓存。
错误:GPG 检查失败
[root@iZ2zeb7ybli3zzdll6airpZ files]#

③ 安装出现签名、秘钥的错误提示

参考:

MySQL :: MySQL 8.0 Reference Manual :: 2.1.4.4 Signature Checking Using RPM

解决CentOS yum安装Mysql8提示“公钥尚未安装”或“密钥已安装,但是不适用于此软件包”的问题_mysql-community-client-plugins-8.0.35-1.el7.x86_64-CSDN博客

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@iZ2zeb7ybli3zzdll6airpZ files]# pwd
/home/files
[root@iZ2zeb7ybli3zzdll6airpZ files]# ll
总用量 32
-rw-r--r-- 1 root root 0 1月 10 23:11 3a79bd29.asc
-rw-r--r-- 1 root root 30388 10月 4 2019 mysql80-community-release-el8-1.noarch.rpm
[root@iZ2zeb7ybli3zzdll6airpZ files]#

[root@iZ2zeb7ybli3zzdll6airpZ files]# rpm --checksig mysql80-community-release-el8-1.noarch.rpm
mysql80-community-release-el8-1.noarch.rpm: digests signatures 确定
[root@iZ2zeb7ybli3zzdll6airpZ files]#
[root@iZ2zeb7ybli3zzdll6airpZ files]# gpg --export -a 3a79bd29 > 3a79bd29.asc
gpg: 目录‘/root/.gnupg’已创建
gpg: 钥匙箱‘/root/.gnupg/pubring.kbx’已创建
gpg: 警告:没有导出任何东西
[root@iZ2zeb7ybli3zzdll6airpZ files]#
[root@iZ2zeb7ybli3zzdll6airpZ files]# rpm --import 3a79bd29.asc
错误:3a79bd29.asc:导入读取时失败(0)。
[root@iZ2zeb7ybli3zzdll6airpZ files]#
[root@iZ2zeb7ybli3zzdll6airpZ files]# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
[root@iZ2zeb7ybli3zzdll6airpZ files]#

④ 重新安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[root@iZ2zeb7ybli3zzdll6airpZ files]# yum install mysql-community-server
上次元数据过期检查:0:10:35 前,执行于 2024年01月10日 星期三 23时05分40秒。
依赖关系解决。
============================================================================================================================================================
软件包 架构 版本 仓库 大小
============================================================================================================================================================
安装:
mysql-community-server x86_64 8.0.35-1.el8 mysql80-community 64 M
安装依赖关系:
mysql-community-client x86_64 8.0.35-1.el8 mysql80-community 16 M
mysql-community-client-plugins x86_64 8.0.35-1.el8 mysql80-community 3.6 M
mysql-community-common x86_64 8.0.35-1.el8 mysql80-community 668 k
mysql-community-icu-data-files x86_64 8.0.35-1.el8 mysql80-community 2.2 M
mysql-community-libs x86_64 8.0.35-1.el8 mysql80-community 1.5 M

事务概要
============================================================================================================================================================
安装 6 软件包

总计:88 M
安装大小:415 M
确定吗?[y/N]: y
下载软件包:
[SKIPPED] mysql-community-client-8.0.35-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-client-plugins-8.0.35-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-common-8.0.35-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-icu-data-files-8.0.35-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-libs-8.0.35-1.el8.x86_64.rpm: Already downloaded
[SKIPPED] mysql-community-server-8.0.35-1.el8.x86_64.rpm: Already downloaded
------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 8.6 GB/s | 88 MB 00:00
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
准备中 : 1/1
安装 : mysql-community-common-8.0.35-1.el8.x86_64 1/6
安装 : mysql-community-client-plugins-8.0.35-1.el8.x86_64 2/6
安装 : mysql-community-libs-8.0.35-1.el8.x86_64 3/6
运行脚本: mysql-community-libs-8.0.35-1.el8.x86_64 3/6
安装 : mysql-community-client-8.0.35-1.el8.x86_64 4/6
安装 : mysql-community-icu-data-files-8.0.35-1.el8.x86_64 5/6
运行脚本: mysql-community-server-8.0.35-1.el8.x86_64 6/6
安装 : mysql-community-server-8.0.35-1.el8.x86_64 6/6
运行脚本: mysql-community-server-8.0.35-1.el8.x86_64 6/6
验证 : mysql-community-client-8.0.35-1.el8.x86_64 1/6
验证 : mysql-community-client-plugins-8.0.35-1.el8.x86_64 2/6
验证 : mysql-community-common-8.0.35-1.el8.x86_64 3/6
验证 : mysql-community-icu-data-files-8.0.35-1.el8.x86_64 4/6
验证 : mysql-community-libs-8.0.35-1.el8.x86_64 5/6
验证 : mysql-community-server-8.0.35-1.el8.x86_64 6/6

已安装:
mysql-community-client-8.0.35-1.el8.x86_64 mysql-community-client-plugins-8.0.35-1.el8.x86_64 mysql-community-common-8.0.35-1.el8.x86_64
mysql-community-icu-data-files-8.0.35-1.el8.x86_64 mysql-community-libs-8.0.35-1.el8.x86_64 mysql-community-server-8.0.35-1.el8.x86_64

完毕!
[root@iZ2zeb7ybli3zzdll6airpZ files]#

4. 启动mysql

1
2
3
4
systemctl start mysqld.service
systemctl status mysqld.service
systemctl restart mysqld.service
systemctl stop mysqld.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[root@iZ2zeb7ybli3zzdll6airpZ files]# systemctl start mysqld.service
[root@iZ2zeb7ybli3zzdll6airpZ files]# systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2024-01-10 23:27:19 CST; 1min 35s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 1177111 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 1180112 (mysqld)
Status: "Server is operational"
Tasks: 37 (limit: 10980)
Memory: 477.3M
CGroup: /system.slice/mysqld.service
└─1180112 /usr/sbin/mysqld

1月 10 23:26:51 iZ2zeb7ybli3zzdll6airpZ systemd[1]: Starting MySQL Server...
1月 10 23:27:19 iZ2zeb7ybli3zzdll6airpZ systemd[1]: Started MySQL Server.
[root@iZ2zeb7ybli3zzdll6airpZ files]#

5. 显示MySQL随机密码

1
2
3
[root@iZ2zeb7ybli3zzdll6airpZ files]# grep 'temporary password' /var/log/mysqld.log
2024-01-10T15:27:15.286777Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: etzuQ%pUv9od
[root@iZ2zeb7ybli3zzdll6airpZ files]#

(1) 修改密码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root_21root'; //因为我们随便修改密码时,一般都不满足它的策略
会报以下错误:
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

解决办法:
一定要先修改默认密码为: Root_21root 满足它的策略,再进行下面的操作:
SHOW VARIABLES LIKE 'validate_password%'; //查看密码策略

修改密码长度:
set global validate_password.length=1; //(长度)
修改密码等级:
set global validate_password.policy=0; //(等级)

设置成自己想要的密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

解决2059 - Authentication plugin ‘caching_sha2_password’ cannot be loaded:

参考:

centos8安装mysql8.0.22教程(超详细)_centos8中mod_auth_mysql-CSDN博客

如果创建mysql的数据库连接报如下错误:2059 - Authentication plugin ‘caching_sha2_password’ cannot be loaded:

从错误信息可知caching_sha2_password不能加载。

以上报错是由于目前已有的客户端连接软件还不支持Mysql8新增加的加密方式caching_sha2_password,所以我们需要修改用户的加密方式,将其改为老的加密验证方式。可以看到当前用户的加密方式为caching_sha2_password。执行以下命令:

1
2
3
4
use mysql;
select user,plugin from user where user='root';
alter user 'root'@'%' identified with mysql_native_password by 'Admin@123';//将用户的加密方式改为mysql_native_password。
flush privileges;//这个一定要执行,执行命令使权限配置项立即生效。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 示例
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>
mysql> select user,plugin from user where user='root';
+------+-----------------------+
| user | plugin |
+------+-----------------------+
| root | caching_sha2_password |
+------+-----------------------+
1 row in set (0.00 sec)

mysql>
mysql> select user,host from user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)

mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'Admin@123';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql>

# 重启MySQL
[root@iZ2zeb7ybli3zzdll6airpZ files]# systemctl restart mysqld.service
[root@iZ2zeb7ybli3zzdll6airpZ files]#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select host from user where user = ‘root’;
ERROR 1054 (42S22): Unknown column '‘root’' in 'where clause'
mysql> select host from user where user = 'root';
+-----------+
| host |
+-----------+
| localhost |
+-----------+
1 row in set (0.00 sec)

mysql> update user set host = '%' where user = 'root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql>
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql>

6. 安装jdk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
[root@iZ2zeb7ybli3zzdll6airpZ java]# pwd
/usr/java
[root@iZ2zeb7ybli3zzdll6airpZ java]#
[root@iZ2zeb7ybli3zzdll6airpZ java]# sudo yum install java-1.8.0-openjdk-devel
上次元数据过期检查:3:18:15 前,执行于 2024年01月11日 星期四 20时43分36秒。
依赖关系解决。
============================================================================================================================================================
软件包 架构 版本 仓库 大小
============================================================================================================================================================
安装:
java-1.8.0-openjdk-devel x86_64 1:1.8.0.312.b07-2.el8_5 AppStream 9.8 M
安装依赖关系:
alsa-lib x86_64 1.2.5-4.el8 AppStream 489 k
atk x86_64 2.28.1-1.el8 AppStream 272 k
compat-lua x86_64 5.1.5-15.el8 epel-archive 77 k
compat-lua-libs x86_64 5.1.5-15.el8 epel-archive 167 k
copy-jdk-configs noarch 4.0-2.el8 AppStream 31 k
fribidi x86_64 1.0.4-8.el8 AppStream 89 k
gdk-pixbuf2-modules x86_64 2.36.12-5.el8 AppStream 109 k
giflib x86_64 5.1.4-3.el8 AppStream 51 k
graphite2 x86_64 1.3.10-10.el8 AppStream 122 k
gtk-update-icon-cache x86_64 3.22.30-8.el8 AppStream 32 k
harfbuzz x86_64 1.7.5-3.el8 AppStream 295 k
hicolor-icon-theme noarch 0.17-2.el8 AppStream 49 k
jasper-libs x86_64 2.0.14-5.el8 AppStream 167 k
java-1.8.0-openjdk x86_64 1:1.8.0.312.b07-2.el8_5 AppStream 341 k
java-1.8.0-openjdk-headless x86_64 1:1.8.0.312.b07-2.el8_5 AppStream 34 M
javapackages-filesystem noarch 5.3.0-1.module_el8.0.0+11+5b8c10bd AppStream 30 k
libXcomposite x86_64 0.4.4-14.el8 AppStream 28 k
libXcursor x86_64 1.1.15-3.el8 AppStream 36 k
libXdamage x86_64 1.1.4-14.el8 AppStream 27 k
libXfixes x86_64 5.0.3-7.el8 AppStream 25 k
libXft x86_64 2.3.3-1.el8 AppStream 67 k
libXi x86_64 1.7.10-1.el8 AppStream 49 k
libXinerama x86_64 1.1.4-1.el8 AppStream 16 k
libXrandr x86_64 1.5.2-1.el8 AppStream 34 k
libXtst x86_64 1.2.3-7.el8 AppStream 22 k
libdatrie x86_64 0.2.9-7.el8 AppStream 33 k
libfontenc x86_64 1.1.3-8.el8 AppStream 37 k
libthai x86_64 0.1.27-2.el8 AppStream 203 k
lksctp-tools x86_64 1.0.18-3.el8 base 100 k
pango x86_64 1.42.4-8.el8 AppStream 297 k
ttmkfdir x86_64 3.0.9-54.el8 AppStream 62 k
tzdata-java noarch 2021e-1.el8 AppStream 191 k
xorg-x11-font-utils x86_64 1:7.5-41.el8 AppStream 104 k
xorg-x11-fonts-Type1 noarch 7.5-19.el8 AppStream 522 k
安装弱的依赖:
gtk2 x86_64 2.24.32-5.el8 AppStream 3.4 M
启用模块流:
javapackages-runtime 201801

事务概要
============================================================================================================================================================
安装 36 软件包

总下载:51 M
安装大小:181 M
确定吗?[y/N]: y
下载软件包:
(1/36): lksctp-tools-1.0.18-3.el8.x86_64.rpm 865 kB/s | 100 kB 00:00
(2/36): atk-2.28.1-1.el8.x86_64.rpm 1.3 MB/s | 272 kB 00:00
(3/36): copy-jdk-configs-4.0-2.el8.noarch.rpm 337 kB/s | 31 kB 00:00
(4/36): fribidi-1.0.4-8.el8.x86_64.rpm 1.1 MB/s | 89 kB 00:00
(5/36): alsa-lib-1.2.5-4.el8.x86_64.rpm 1.6 MB/s | 489 kB 00:00
(6/36): gdk-pixbuf2-modules-2.36.12-5.el8.x86_64.rpm 923 kB/s | 109 kB 00:00
(7/36): giflib-5.1.4-3.el8.x86_64.rpm 504 kB/s | 51 kB 00:00
(8/36): graphite2-1.3.10-10.el8.x86_64.rpm 1.1 MB/s | 122 kB 00:00
(9/36): gtk-update-icon-cache-3.22.30-8.el8.x86_64.rpm 280 kB/s | 32 kB 00:00
(10/36): gtk2-2.24.32-5.el8.x86_64.rpm 23 MB/s | 3.4 MB 00:00
(11/36): harfbuzz-1.7.5-3.el8.x86_64.rpm 2.2 MB/s | 295 kB 00:00
(12/36): hicolor-icon-theme-0.17-2.el8.noarch.rpm 278 kB/s | 49 kB 00:00
(13/36): java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64.rpm 2.6 MB/s | 341 kB 00:00
(14/36): jasper-libs-2.0.14-5.el8.x86_64.rpm 1.2 MB/s | 167 kB 00:00
(15/36): javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch.rpm 463 kB/s | 30 kB 00:00
(16/36): libXcomposite-0.4.4-14.el8.x86_64.rpm 352 kB/s | 28 kB 00:00
(17/36): java-1.8.0-openjdk-devel-1.8.0.312.b07-2.el8_5.x86_64.rpm 38 MB/s | 9.8 MB 00:00
(18/36): libXcursor-1.1.15-3.el8.x86_64.rpm 490 kB/s | 36 kB 00:00
(19/36): libXdamage-1.1.4-14.el8.x86_64.rpm 333 kB/s | 27 kB 00:00
(20/36): libXfixes-5.0.3-7.el8.x86_64.rpm 335 kB/s | 25 kB 00:00
(21/36): libXft-2.3.3-1.el8.x86_64.rpm 759 kB/s | 67 kB 00:00
(22/36): libXi-1.7.10-1.el8.x86_64.rpm 559 kB/s | 49 kB 00:00
(23/36): libXinerama-1.1.4-1.el8.x86_64.rpm 248 kB/s | 16 kB 00:00
(24/36): libXrandr-1.5.2-1.el8.x86_64.rpm 527 kB/s | 34 kB 00:00
(25/36): libdatrie-0.2.9-7.el8.x86_64.rpm 461 kB/s | 33 kB 00:00
(26/36): libXtst-1.2.3-7.el8.x86_64.rpm 216 kB/s | 22 kB 00:00
(27/36): libfontenc-1.1.3-8.el8.x86_64.rpm 672 kB/s | 37 kB 00:00
(28/36): libthai-0.1.27-2.el8.x86_64.rpm 2.2 MB/s | 203 kB 00:00
(29/36): java-1.8.0-openjdk-headless-1.8.0.312.b07-2.el8_5.x86_64.rpm 44 MB/s | 34 MB 00:00
(30/36): ttmkfdir-3.0.9-54.el8.x86_64.rpm 434 kB/s | 62 kB 00:00
(31/36): pango-1.42.4-8.el8.x86_64.rpm 1.5 MB/s | 297 kB 00:00
(32/36): xorg-x11-fonts-Type1-7.5-19.el8.noarch.rpm 7.6 MB/s | 522 kB 00:00
(33/36): xorg-x11-font-utils-7.5-41.el8.x86_64.rpm 1.1 MB/s | 104 kB 00:00
(34/36): tzdata-java-2021e-1.el8.noarch.rpm 1.8 MB/s | 191 kB 00:00
(35/36): compat-lua-5.1.5-15.el8.x86_64.rpm 751 kB/s | 77 kB 00:00
(36/36): compat-lua-libs-5.1.5-15.el8.x86_64.rpm 1.9 MB/s | 167 kB 00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 32 MB/s | 51 MB 00:01
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
运行脚本: copy-jdk-configs-4.0-2.el8.noarch 1/1
运行脚本: java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64 1/1
准备中 : 1/1
安装 : libXi-1.7.10-1.el8.x86_64 1/36
安装 : libXfixes-5.0.3-7.el8.x86_64 2/36
安装 : libXcomposite-0.4.4-14.el8.x86_64 3/36
安装 : libXcursor-1.1.15-3.el8.x86_64 4/36
安装 : libXdamage-1.1.4-14.el8.x86_64 5/36
安装 : libXtst-1.2.3-7.el8.x86_64 6/36
安装 : compat-lua-libs-5.1.5-15.el8.x86_64 7/36
安装 : compat-lua-5.1.5-15.el8.x86_64 8/36
安装 : copy-jdk-configs-4.0-2.el8.noarch 9/36
安装 : tzdata-java-2021e-1.el8.noarch 10/36
安装 : ttmkfdir-3.0.9-54.el8.x86_64 11/36
安装 : libfontenc-1.1.3-8.el8.x86_64 12/36
安装 : xorg-x11-font-utils-1:7.5-41.el8.x86_64 13/36
安装 : xorg-x11-fonts-Type1-7.5-19.el8.noarch 14/36
运行脚本: xorg-x11-fonts-Type1-7.5-19.el8.noarch 14/36
安装 : libdatrie-0.2.9-7.el8.x86_64 15/36
运行脚本: libdatrie-0.2.9-7.el8.x86_64 15/36
安装 : libthai-0.1.27-2.el8.x86_64 16/36
运行脚本: libthai-0.1.27-2.el8.x86_64 16/36
安装 : libXrandr-1.5.2-1.el8.x86_64 17/36
安装 : libXinerama-1.1.4-1.el8.x86_64 18/36
安装 : libXft-2.3.3-1.el8.x86_64 19/36
安装 : javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch 20/36
安装 : jasper-libs-2.0.14-5.el8.x86_64 21/36
安装 : gdk-pixbuf2-modules-2.36.12-5.el8.x86_64 22/36
安装 : hicolor-icon-theme-0.17-2.el8.noarch 23/36
安装 : gtk-update-icon-cache-3.22.30-8.el8.x86_64 24/36
安装 : graphite2-1.3.10-10.el8.x86_64 25/36
安装 : harfbuzz-1.7.5-3.el8.x86_64 26/36
运行脚本: harfbuzz-1.7.5-3.el8.x86_64 26/36
安装 : giflib-5.1.4-3.el8.x86_64 27/36
安装 : fribidi-1.0.4-8.el8.x86_64 28/36
安装 : pango-1.42.4-8.el8.x86_64 29/36
运行脚本: pango-1.42.4-8.el8.x86_64 29/36
安装 : atk-2.28.1-1.el8.x86_64 30/36
安装 : gtk2-2.24.32-5.el8.x86_64 31/36
运行脚本: gtk2-2.24.32-5.el8.x86_64 31/36
安装 : alsa-lib-1.2.5-4.el8.x86_64 32/36
运行脚本: alsa-lib-1.2.5-4.el8.x86_64 32/36
安装 : lksctp-tools-1.0.18-3.el8.x86_64 33/36
运行脚本: lksctp-tools-1.0.18-3.el8.x86_64 33/36
安装 : java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64 34/36
运行脚本: java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64 34/36
安装 : java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64 35/36
运行脚本: java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64 35/36
安装 : java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64 36/36
运行脚本: java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64 36/36
运行脚本: copy-jdk-configs-4.0-2.el8.noarch 36/36
运行脚本: java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64 36/36
运行脚本: java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64 36/36
运行脚本: hicolor-icon-theme-0.17-2.el8.noarch 36/36
验证 : lksctp-tools-1.0.18-3.el8.x86_64 1/36
验证 : alsa-lib-1.2.5-4.el8.x86_64 2/36
验证 : atk-2.28.1-1.el8.x86_64 3/36
验证 : copy-jdk-configs-4.0-2.el8.noarch 4/36
验证 : fribidi-1.0.4-8.el8.x86_64 5/36
验证 : gdk-pixbuf2-modules-2.36.12-5.el8.x86_64 6/36
验证 : giflib-5.1.4-3.el8.x86_64 7/36
验证 : graphite2-1.3.10-10.el8.x86_64 8/36
验证 : gtk-update-icon-cache-3.22.30-8.el8.x86_64 9/36
验证 : gtk2-2.24.32-5.el8.x86_64 10/36
验证 : harfbuzz-1.7.5-3.el8.x86_64 11/36
验证 : hicolor-icon-theme-0.17-2.el8.noarch 12/36
验证 : jasper-libs-2.0.14-5.el8.x86_64 13/36
验证 : java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64 14/36
验证 : java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64 15/36
验证 : java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64 16/36
验证 : javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch 17/36
验证 : libXcomposite-0.4.4-14.el8.x86_64 18/36
验证 : libXcursor-1.1.15-3.el8.x86_64 19/36
验证 : libXdamage-1.1.4-14.el8.x86_64 20/36
验证 : libXfixes-5.0.3-7.el8.x86_64 21/36
验证 : libXft-2.3.3-1.el8.x86_64 22/36
验证 : libXi-1.7.10-1.el8.x86_64 23/36
验证 : libXinerama-1.1.4-1.el8.x86_64 24/36
验证 : libXrandr-1.5.2-1.el8.x86_64 25/36
验证 : libXtst-1.2.3-7.el8.x86_64 26/36
验证 : libdatrie-0.2.9-7.el8.x86_64 27/36
验证 : libfontenc-1.1.3-8.el8.x86_64 28/36
验证 : libthai-0.1.27-2.el8.x86_64 29/36
验证 : pango-1.42.4-8.el8.x86_64 30/36
验证 : ttmkfdir-3.0.9-54.el8.x86_64 31/36
验证 : tzdata-java-2021e-1.el8.noarch 32/36
验证 : xorg-x11-font-utils-1:7.5-41.el8.x86_64 33/36
验证 : xorg-x11-fonts-Type1-7.5-19.el8.noarch 34/36
验证 : compat-lua-5.1.5-15.el8.x86_64 35/36
验证 : compat-lua-libs-5.1.5-15.el8.x86_64 36/36

已安装:
alsa-lib-1.2.5-4.el8.x86_64 atk-2.28.1-1.el8.x86_64
compat-lua-5.1.5-15.el8.x86_64 compat-lua-libs-5.1.5-15.el8.x86_64
copy-jdk-configs-4.0-2.el8.noarch fribidi-1.0.4-8.el8.x86_64
gdk-pixbuf2-modules-2.36.12-5.el8.x86_64 giflib-5.1.4-3.el8.x86_64
graphite2-1.3.10-10.el8.x86_64 gtk-update-icon-cache-3.22.30-8.el8.x86_64
gtk2-2.24.32-5.el8.x86_64 harfbuzz-1.7.5-3.el8.x86_64
hicolor-icon-theme-0.17-2.el8.noarch jasper-libs-2.0.14-5.el8.x86_64
java-1.8.0-openjdk-1:1.8.0.312.b07-2.el8_5.x86_64 java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64
java-1.8.0-openjdk-headless-1:1.8.0.312.b07-2.el8_5.x86_64 javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch
libXcomposite-0.4.4-14.el8.x86_64 libXcursor-1.1.15-3.el8.x86_64
libXdamage-1.1.4-14.el8.x86_64 libXfixes-5.0.3-7.el8.x86_64
libXft-2.3.3-1.el8.x86_64 libXi-1.7.10-1.el8.x86_64
libXinerama-1.1.4-1.el8.x86_64 libXrandr-1.5.2-1.el8.x86_64
libXtst-1.2.3-7.el8.x86_64 libdatrie-0.2.9-7.el8.x86_64
libfontenc-1.1.3-8.el8.x86_64 libthai-0.1.27-2.el8.x86_64
lksctp-tools-1.0.18-3.el8.x86_64 pango-1.42.4-8.el8.x86_64
ttmkfdir-3.0.9-54.el8.x86_64 tzdata-java-2021e-1.el8.noarch
xorg-x11-font-utils-1:7.5-41.el8.x86_64 xorg-x11-fonts-Type1-7.5-19.el8.noarch

完毕!
[root@iZ2zeb7ybli3zzdll6airpZ java]#
[root@iZ2zeb7ybli3zzdll6airpZ java]# java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
[root@iZ2zeb7ybli3zzdll6airpZ java]#

7. 安装Redis

Linux-CentOS8.0下安装Redis_centos8 离线安装redis(gcc、make、redis)-CSDN博客

1. redis开启远程连接

[Redis 开启远程连接的Redis端口|极客教程 (geek-docs.com)](https://geek-docs.com/redis/redis-ask-answer/34_redis_open_redis_port_for_remote_connections.html#:~:text=Redis 开启远程连接的Redis端口 1 了解Redis远程连接 默认情况下,Redis只允许本地连接,即只能在本地服务器上访问Redis数据库。 这是为了保证数据的安全性,防止未经授权的访问。 … 2,4 远程连接到Redis 现在,我们已经成功开启了Redis的远程连接端口,让我们看看如何远程连接到Redis数据库。 … 5 总结 通过本文,我们了解了如何开启Redis的远程连接端口,以便在其他远程服务器上连接和管理Redis数据库。 )

(1) 修改Redis配置文件

1
2
3
4
[root@iZ2zeb7ybli3zzdll6airpZ ~]# vim /etc/redis.conf
[root@iZ2zeb7ybli3zzdll6airpZ ~]# systemctl restart redis
[root@iZ2zeb7ybli3zzdll6airpZ ~]#
[root@iZ2zeb7ybli3zzdll6airpZ ~]# systemctl status redis

在打开的配置文件中,我们需要找到以下行:

1
#bind 127.0.0.1

将其修改为:

1
bind 0.0.0.0

这将允许Redis接受来自任意IP地址的连接请求。

另外,我们还需要找到以下行:

1
# protected-mode yes

将其修改为:

1
protected-mode no

这将关闭Redis的保护模式,允许远程连接。

完成以上修改后,保存并关闭配置文件。

2. vi/vim下如何搜索字符串

  1. 命令模式下,输入

    1
    :/字符串

比如搜索user, 输入/user

按下回车之后,可以看到vim已经把光标移动到该字符处和高亮了匹配的字符串

  1. 查看下一个匹配,按下n(小写n)

  2. 跳转到上一个匹配,按下N(大写N)

  3. 搜索后,我们打开别的文件,发现也被高亮了,怎么关闭高亮?

    命令模式下,输入:nohlsearch  也可以:set nohlsearch; 当然,可以简写,noh或者set noh。
    

原文链接:https://blog.csdn.net/whynotldch/article/details/78163480


Centos 8 环境配置
https://chris-z-su.github.io/2024/03/07/linux/Centos 8 环境配置/
作者
Chris
发布于
2024年3月7日
许可协议