Windows系统中使用MySQL Configurator工具安装MySQL9.0解压版

Windows系统中使用MySQL Configurator工具安装MySQL9.0解压版

昨天把公司报废的电脑搬了回来,配置其实还不错,就拿来写代码吧。那么,像MySQL这些基础环境是必不可少的。我一般喜欢通过命令的方式安装压缩版的软件,更精简一些。

先去官网下载Mysql9.0压缩包

解压之后,进入到mysqlbin目录,我们可以看到一个mysql_configurator.exe可执行文件。

双击打开该程序

我们来一次进行配置,首先配置文件目录

然后配置端口,无特殊情况,默认即可

设置用户名及密码

配置Windows服务名,如无特殊要求,默认即可

然后执行配置


执行完成后直接下一步

至此,我们的Mysql9.0就安装完啦。

我们也可以查看工具整个过程的执行日志

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
Beginning configuration step: Writing configuration file

Saving my.ini configuration file...
Saved my.ini configuration file.
Ended configuration step: Writing configuration file

Beginning configuration step: Updating Windows Firewall rules

Adding a Windows Firewall rule for MySQL90 on port 3306.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow
确定。


Successfully added the Windows Firewall rule.
Adding a Windows Firewall rule for MySQL90 on port 33060.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 33060" protocol=TCP localport=33060 dir=in action=allow
确定。


Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules

Beginning configuration step: Adjusting Windows service

Attempting to grant the required filesystem permissions to the 'NT AUTHORITY\NetworkService' account.
Granted permissions to the data directory.
Granted permissions to the install directory.
Adding new service
New service added
Ended configuration step: Adjusting Windows service

Beginning configuration step: Initializing database (may take a long time)

Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 9.0.0...
Starting process with command: D:\tool\mysql-9.0.0-winx64\bin\mysqld.exe --defaults-file="D:\MySQL\MySQL Server 9.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
MySQL Server Initialization - start.
D:\tool\mysql-9.0.0-winx64\bin\mysqld.exe (mysqld 9.0.0) initializing of server in progress as process 2840
InnoDB initialization has started.
InnoDB initialization has ended.
root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
MySQL Server Initialization - end.
Process for mysqld, with ID 2840, was run successfully and exited with code 0.
Successfully started process for MySQL Server 9.0.0.
MySQL Server 9.0.0 intialized the database successfully.
Ended configuration step: Initializing database (may take a long time)

Beginning configuration step: Updating permissions for the data folder and related server files

Attempting to update the permissions for the data folder and related server files...
Inherited permissions have been converted to explicit permissions.
Full control permissions granted to: NETWORK SERVICE.
Full control permissions granted to: Administrators.
Full control permissions granted to: CREATOR OWNER.
Full control permissions granted to: SYSTEM.
Access to the data directory is removed for the users group.
Permissions for the data folder and related server files are updated correctly.
Ended configuration step: Updating permissions for the data folder and related server files

Beginning configuration step: Starting the server

Attempting to start service MySQL90...
MySQL Server - start.
D:\tool\mysql-9.0.0-winx64\bin\mysqld.exe (mysqld 9.0.0) starting as process 23364
InnoDB initialization has started..
InnoDB initialization has ended.
CA certificate ca.pem is self signed.
Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
X Plugin ready for connections. Bind-address: '::' port: 33060
D:\tool\mysql-9.0.0-winx64\bin\mysqld.exe: ready for connections. Version: '9.0.0' socket: '' port: 3306 MySQL Community Server - GPL.
Successfully started service MySQL90.
Waiting until a connection to MySQL Server 9.0.0 can be established (with a maximum of 10 attempts)...
Retry 1: Attempting to connect to Mysql@localhost:3306 with user root with no password...
Successfully connected to MySQL Server 9.0.0.
Ended configuration step: Starting the server

Beginning configuration step: Applying security settings

Attempting to update security settings.
Updated security settings.
Ended configuration step: Applying security settings


这个过程是相当顺利的,咱们去看看Windows Service中有没有MySQL90这个服务

可以看到,服务已经存在且正常启动,那么咱们用免费的Navicat Premium Lite 17来连接一下我们的MySQL服务,看能否正常连接。

好了。目前来看,咱们安装的MySQL一切正常。我来看看工具为我们注册的启动服务的参数。

1
"D:\tool\mysql-9.0.0-winx64\bin\mysqld.exe" --defaults-file="D:\MySQL\MySQL Server 9.0\my.ini" MySQL90

我们下载的MySQL压缩目录是没有配置文件的,但是,我们在通过mysql_configurator工具配置好后,会自动在数据目录下生成一个配置文件

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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
  # Other default tuning values
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows, when MySQL has been installed using MySQL Installer you
# should keep this file in the ProgramData directory of your server
# (e.g. C:\ProgramData\MySQL\MySQL Server X.Y). To make sure the server
# reads the config file, use the startup option "--defaults-file".
#
# To run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# To install the server as a Windows service manually, execute this in a
# command line shell, e.g.
# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guidelines for editing this file
# ----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the "--help" option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
# For advice on how to change settings please see
# https://dev.mysql.com/doc/refman/9.0/en/server-configuration-defaults.html
#
#
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]

# pipe=

# socket=MYSQL

port=3306

[mysql]
no-beep

# default-character-set=

# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]

# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory

# shared-memory-base-name=MYSQL

# The Pipe the MySQL Server will use.
# socket=MYSQL

# The access control granted to clients on the named pipe created by the MySQL Server.
# named-pipe-full-access-group=

# The TCP/IP Port the MySQL Server will listen on
port=3306

# Path to installation directory. All paths are usually resolved relative to this.
# basedir="D:/tool/mysql-9.0.0-winx64"

# Path to the database root
datadir=D:/MySQL/MySQL Server 9.0/Data

# The default character set that will be used when a new schema or table is
# created and no character set is defined
# character-set-server=

# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB

# The current server SQL mode, which can be set dynamically.
# Modes affect the SQL syntax MySQL supports and the data validation checks it performs. This
# makes it easier to use MySQL in different environments and to use MySQL together with other
# database servers.
sql-mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

# General and Slow logging.
log-output=FILE

general-log=0

general_log_file="DESKTOP-DDFJN96.log"

slow-query-log=1

slow_query_log_file="DESKTOP-DDFJN96-slow.log"

long_query_time=10

# Error Logging.
log-error="DESKTOP-DDFJN96.err"

# ***** Group Replication Related *****
# Specifies the base name to use for binary log files. With binary logging
# enabled, the server logs all statements that change data to the binary
# log, which is used for backup and replication.
log-bin="DESKTOP-DDFJN96-bin"

# ***** Group Replication Related *****
# Specifies the server ID. For servers that are used in a replication topology,
# you must specify a unique server ID for each replication server, in the
# range from 1 to 2^32 − 1. "Unique" means that each ID must be different
# from every other ID in use by any other source or replica.
server-id=1

# Indicates how table and database names are stored on disk and used in MySQL.
# Value 0 = Table and database names are stored on disk using the lettercase specified in the CREATE
# TABLE or CREATE DATABASE statement. Name comparisons are case-sensitive. You should not
# set this variable to 0 if you are running MySQL on a system that has case-insensitive file
# names (such as Windows or macOS). If you force this variable to 0 with
# --lower-case-table-names=0 on a case-insensitive file system and access MyISAM tablenames
# using different lettercases, index corruption may result.
# Value 1 = Table names are stored in lowercase on disk and name comparisons are not case-sensitive.
# MySQL converts all table names to lowercase on storage and lookup. This behavior also applies
# to database names and table aliases.
# Value 2 = Table and database names are stored on disk using the lettercase specified in the CREATE TABLE
# or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons
# are not case-sensitive. This works only on file systems that are not case-sensitive! InnoDB
# table names and view names are stored in lowercase, as for lower_case_table_names=1.
lower_case_table_names=1

# This variable is used to limit the effect of data import and export operations, such as
# those performed by the LOAD DATA and SELECT ... INTO OUTFILE statements and the
# LOAD_FILE() function. These operations are permitted only to users who have the FILE privilege.
secure-file-priv="D:/MySQL/MySQL Server 9.0/Uploads"

# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=151

# The number of open tables for all threads. Increasing this value increases the number
# of file descriptors that mysqld requires.
table_open_cache=4000

# Defines the maximum amount of memory that can be occupied by the TempTable
# storage engine before it starts storing data on disk.
temptable_max_ram=1G

# Defines the maximum size of internal in-memory temporary tables created
# by the MEMORY storage engine and, as of MySQL 8.0.28, the TempTable storage
# engine. If an internal in-memory temporary table exceeds this size, it is
# automatically converted to an on-disk internal temporary table.
tmp_table_size=111M

# The storage engine for in-memory internal temporary tables (see Section 8.4.4, "Internal
# Temporary Table Use in MySQL"). Permitted values are TempTable (the default) and MEMORY.
internal_tmp_mem_storage_engine=TempTable

#*** MyISAM Specific options
# The maximum size of the temporary file that MySQL is permitted to use while re-creating a
# MyISAM index (during REPAIR TABLE, ALTER TABLE, or LOAD DATA). If the file size would be
# larger than this value, the index is created using the key cache instead, which is slower.
# The value is given in bytes.
myisam_max_sort_file_size=2146435072

# The size of the buffer that is allocated when sorting MyISAM indexes during a REPAIR TABLE
# or when creating indexes with CREATE INDEX or ALTER TABLE.
myisam_sort_buffer_size=212M

# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you're not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
key_buffer_size=8M

# Each thread that does a sequential scan for a MyISAM table allocates a buffer
# of this size (in bytes) for each table it scans. If you do many sequential
# scans, you might want to increase this value, which defaults to 131072. The
# value of this variable should be a multiple of 4KB. If it is set to a value
# that is not a multiple of 4KB, its value is rounded down to the nearest multiple
# of 4KB.
read_buffer_size=128K

# This variable is used for reads from MyISAM tables, and, for any storage engine,
# for Multi-Range Read optimization.
read_rnd_buffer_size=256K

#*** INNODB Specific options ***
# innodb_data_home_dir=

# Use this option if you have a MySQL server with InnoDB support enabled
# but you do not plan to use it. This will save memory and disk space
# and speed up some things.
# skip-innodb

# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit=1

# The size in bytes of the buffer that InnoDB uses to write to the log files on
# disk. The default value changed from 8MB to 16MB with the introduction of 32KB
# and 64KB innodb_page_size values. A large log buffer enables large transactions
# to run without the need to write the log to disk before the transactions commit.
# Thus, if you have transactions that update, insert, or delete many rows, making
# the log buffer larger saves disk I/O.
innodb_log_buffer_size=16M

# The size in bytes of the buffer pool, the memory area where InnoDB caches table
# and index data. The default value is 134217728 bytes (128MB). The maximum value
# depends on the CPU architecture; the maximum is 4294967295 (232-1) on 32-bit systems
# and 18446744073709551615 (264-1) on 64-bit systems. On 32-bit systems, the CPU
# architecture and operating system may impose a lower practical maximum size than the
# stated maximum. When the size of the buffer pool is greater than 1GB, setting
# innodb_buffer_pool_instances to a value greater than 1 can improve the scalability on
# a busy server.
innodb_buffer_pool_size=128M

# Defines the amount of disk space occupied by redo log files. This variable supersedes the
# innodb_log_files_in_group and innodb_log_file_size variables.
innodb_redo_log_capacity=100M

# Defines the maximum number of threads permitted inside of InnoDB. A value
# of 0 (the default) is interpreted as infinite concurrency (no limit). This
# variable is intended for performance tuning on high concurrency systems.
# InnoDB tries to keep the number of threads inside InnoDB less than or equal to
# the innodb_thread_concurrency limit. Once the limit is reached, additional threads
# are placed into a "First In, First Out" (FIFO) queue for waiting threads. Threads
# waiting for locks are not counted in the number of concurrently executing threads.
innodb_thread_concurrency=13

# The increment size (in MB) for extending the size of an auto-extend InnoDB system tablespace file when it becomes full.
innodb_autoextend_increment=64

# The number of regions that the InnoDB buffer pool is divided into.
# For systems with buffer pools in the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency,
# by reducing contention as different threads read and write to cached pages.
innodb_buffer_pool_instances=8

# Determines the number of threads that can enter InnoDB concurrently.
innodb_concurrency_tickets=5000

# Specifies how long in milliseconds (ms) a block inserted into the old sublist must stay there after its first access before
# it can be moved to the new sublist.
innodb_old_blocks_time=1000

# When this variable is enabled, InnoDB updates statistics during metadata statements.
innodb_stats_on_metadata=0

# When innodb_file_per_table is enabled (the default in 5.6.6 and higher), InnoDB stores the data and indexes for each newly created table
# in a separate .ibd file, rather than in the system tablespace.
innodb_file_per_table=1

# Use the following list of values: 0 for crc32, 1 for strict_crc32, 2 for innodb, 3 for strict_innodb, 4 for none, 5 for strict_none.
innodb_checksum_algorithm=0

# If this is set to a nonzero value, all tables are closed every flush_time seconds to free up resources and
# synchronize unflushed data to disk.
# This option is best used only on systems with minimal resources.
flush_time=0

# The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use
# indexes and thus perform full table scans.
join_buffer_size=256K

# The maximum size of one packet or any generated or intermediate string, or any parameter sent by the
# mysql_stmt_send_long_data() C API function.
max_allowed_packet=64M

# If more than this many successive connection requests from a host are interrupted without a successful connection,
# the server blocks that host from performing further connections.
max_connect_errors=100

# The number of file descriptors available to mysqld from the operating system
# Try increasing the value of this option if mysqld gives the error "Too many open files".
open_files_limit=8161

# If you see many sort_merge_passes per second in SHOW GLOBAL STATUS output, you can consider increasing the
# sort_buffer_size value to speed up ORDER BY or GROUP BY operations that cannot be improved with query optimization
# or improved indexing.
sort_buffer_size=256K

# Specify the maximum size of a row-based binary log event, in bytes.
# Rows are grouped into events smaller than this size if possible. The value should be a multiple of 256.
binlog_row_event_max_size=8K


# If the value of this variable is greater than 0, a replica synchronizes its master.info file to disk.
# (using fdatasync()) after every sync_source_info events.
sync_source_info=10000

# If the value of this variable is greater than 0, the MySQL server synchronizes its relay log to disk.
# (using fdatasync()) after every sync_relay_log writes to the relay log.
sync_relay_log=10000

# Load mysql plugins at start."plugin_x ; plugin_y".
# plugin_load

# The TCP/IP Port the MySQL Server X Protocol will listen on.
mysqlx_port=33060

以前在安装压缩版的时候,我习惯性的在网上去找my.ini的配置复制下来,然后再执行--initialize-insecure命令和install命令。但是mysql_configurator用起来更方便。

Windows系统中使用MySQL Configurator工具安装MySQL9.0解压版

https://blogs.52fx.biz/posts/1656112507.html

作者

eyiadmin

发布于

2024-07-13

更新于

2024-07-13

许可协议

评论