我是靠谱客的博主 飘逸嚓茶,这篇文章主要介绍MySQL 8.0.15 YUM安装,现在分享给大家,希望可以做个参考。

复制代码
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
YUM 安装便于快速的进行试验论证,安装配置都非常方便。 #wget https://repo.mysql.com//mysql80-community-release-el7-2.noarch.rpm --默认安装MySQL的最新版本: #yum -y install mysql-community-libs-compat mysql-community-server mysql-community-client mysql-community-common mysql-community-devel mysql-community-libs mysql-community-libs-compat --安装指定版本: # yum search mysql --showduplicates # rpm -qa | grep -i mysql MySQL-python-1.2.5-1.el7.x86_64 mysql80-community-release-el7-2.noarch mysql-community-client-8.0.15-1.el7.x86_64 mysql-community-devel-8.0.15-1.el7.x86_64 mysql-community-libs-8.0.15-1.el7.x86_64 mysql-community-libs-compat-8.0.15-1.el7.x86_64 mysql-community-common-8.0.15-1.el7.x86_64 mysql-community-server-8.0.15-1.el7.x86_64 -- 设置参数: # cat /etc/my.cnf [mysqld] join_buffer_size = 128M sort_buffer_size = 2M read_rnd_buffer_size = 2M default-authentication-plugin=mysql_native_password log-error = error.log slow-query-log = 1 slow-query-log-file = slow.log long_query_time = 0.2 log-bin = bin.log relay-log = relay.log binlog_format =ROW interactive_timeout = 172800 wait_timeout = 172800 max_prepared_stmt_count =1048576 max_connections = 8000 binlog_expire_logs_seconds = 86400 relay_log_recovery = 1 character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci init_connect ='SET NAMES utf8mb4' innodb_buffer_pool_size = 1G join_buffer_size = 128M sort_buffer_size = 2M read_rnd_buffer_size = 2M log_timestamps = SYSTEM lower_case_table_names = 1 default-authentication-plugin =mysql_native_password datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid --启动: # systemctl restart mysqld --登录: # cat /var/log/mysqld.log | grep -i password 2019-04-24T12:06:23.562547+08:00 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: frNNAc:/8c4w 说明:随机产生一个密码需要复制粘贴进入即可。 [root@datanode3 ~]# mysql -p Enter password: mysql> select host,user,authentication_string from mysql.user; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> alter user root@'localhost' identified by 'oracle'; ERROR 1819 (HY000): Your password does not satisfy the current policy requirements mysql> alter user root@'localhost' identified by 'oracle@12C'; Query OK, 0 rows affected (0.00 sec) --查看默认安装的密码策略: mysql> show variables like '%valid%'; +--------------------------------------+--------+ | Variable_name | Value | +--------------------------------------+--------+ | validate_password.check_user_name | ON | | validate_password.dictionary_file | | | validate_password.length | 8 | | validate_password.mixed_case_count | 1 | | validate_password.number_count | 1 | | validate_password.policy | MEDIUM | | validate_password.special_char_count | 1 | +--------------------------------------+--------+ 7 rows in set (0.02 sec) --修改密码策略使之生效: mysql> set global validate_password.policy=0 ; Query OK, 0 rows affected (0.00 sec) mysql> show variables like '%valid%'; +--------------------------------------+-------+ | Variable_name | Value | +--------------------------------------+-------+ | validate_password.check_user_name | ON | | validate_password.dictionary_file | | | validate_password.length | 8 | | validate_password.mixed_case_count | 1 | | validate_password.number_count | 1 | | validate_password.policy | LOW | | validate_password.special_char_count | 1 | +--------------------------------------+-------+ 7 rows in set (0.00 sec) --密码策略安装和卸载: INSTALL COMPONENT 'file://component_validate_password'; UNINSTALL COMPONENT 'file://component_validate_password'; --在开发环境设置:去掉密码复杂度验证。 mysql> UNINSTALL COMPONENT 'file://component_validate_password'; Query OK, 0 rows affected (0.02 sec) mysql> show variables like '%valid%'; Empty set (0.00 sec) mysql> create user root@'%' identified by 'oracle'; Query OK, 0 rows affected (0.01 sec) mysql> grant all privileges on *.* to root@'%' with grant option; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> alter user root@'localhost' identified by 'oracle'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> select host,user from mysql.user; +-----------+------------------+ | host | user | +-----------+------------------+ | % | root | | localhost | mysql.infoschema | | localhost | mysql.session | | localhost | mysql.sys | | localhost | root | +-----------+------------------+ 5 rows in set (0.00 sec) -- 创建带认证方式的用户: mysql> create user root@'%' IDENTIFIED WITH mysql_native_password BY 'oracle'; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on *.* to root@'%' with grant option; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; mysql> select host,user,plugin from mysql.user; +-----------+------------------+-----------------------+ | host | user | plugin | +-----------+------------------+-----------------------+ | % | root | mysql_native_password | | localhost | mysql.infoschema | caching_sha2_password | | localhost | mysql.session | caching_sha2_password | | localhost | mysql.sys | caching_sha2_password | | localhost | root | caching_sha2_password | +-----------+------------------+-----------------------+ 5 rows in set (0.00 sec) 默认采用的认证方式为caching_sha2_password ,默认采用的字母区分大小写,默认采用的字符集为utf8mb4. mysql> show variables like '%char%'; +--------------------------------------+--------------------------------+ | Variable_name | Value | +--------------------------------------+--------------------------------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | utf8mb4 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | utf8mb4 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql-8.0/charsets/ | | validate_password.special_char_count | 1 | +--------------------------------------+--------------------------------+ 9 rows in set (0.02 sec) mysql> show variables like '%col%'; +---------------------------------+------------------------+ | Variable_name | Value | +---------------------------------+------------------------+ | collation_connection | utf8mb4_0900_ai_ci | | collation_database | utf8mb4_0900_ai_ci | | collation_server | utf8mb4_0900_ai_ci | | default_collation_for_utf8mb4 | utf8mb4_0900_ai_ci | | protocol_compression_algorithms | zlib,zstd,uncompressed | | protocol_version | 10 | | slave_compressed_protocol | OFF | +---------------------------------+------------------------+ 7 rows in set (0.00 sec) mysql> show variables like 'lower%'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | lower_case_file_system | OFF | | lower_case_table_names | 0 | +------------------------+-------+ 2 rows in set (0.00 sec) 0表示严格区分大小写,1表示不区分。

 

最后

以上就是飘逸嚓茶最近收集整理的关于MySQL 8.0.15 YUM安装的全部内容,更多相关MySQL内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(55)

评论列表共有 0 条评论

立即
投稿
返回
顶部