· 6 years ago · Jan 10, 2020, 02:52 PM
1# Other default tuning values
2# MySQL Server Instance Configuration File
3# ----------------------------------------------------------------------
4# Generated by the MySQL Server Instance Configuration Wizard
5#
6#
7# Installation Instructions
8# ----------------------------------------------------------------------
9#
10# On Linux you can copy this file to /etc/my.cnf to set global options,
11# mysql-data-dir/my.cnf to set server-specific options
12# (@localstatedir@ for this installation) or to
13# ~/.my.cnf to set user-specific options.
14#
15# On Windows you should keep this file in the installation directory
16# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
17# make sure the server reads the config file use the startup option
18# "--defaults-file".
19#
20# To run the server from the command line, execute this in a
21# command line shell, e.g.
22# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
23#
24# To install the server as a Windows service manually, execute this in a
25# command line shell, e.g.
26# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
27#
28# And then execute this in a command line shell to start the server, e.g.
29# net start MySQLXY
30#
31#
32# Guidelines for editing this file
33# ----------------------------------------------------------------------
34#
35# In this file, you can use all long options that the program supports.
36# If you want to know the options a program supports, start the program
37# with the "--help" option.
38#
39# More detailed information about the individual options can also be
40# found in the manual.
41#
42# For advice on how to change settings please see
43# https://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
44#
45#
46# CLIENT SECTION
47# ----------------------------------------------------------------------
48#
49# The following options will be read by MySQL client applications.
50# Note that only client applications shipped by MySQL are guaranteed
51# to read this section. If you want your own MySQL client program to
52# honor these values, you need to specify it as an option during the
53# MySQL client library initialization.
54#
55[client]
56
57# pipe=
58
59# socket=MYSQL
60
61port=3306
62
63[mysql]
64no-beep
65
66# default-character-set=
67
68# SERVER SECTION
69# ----------------------------------------------------------------------
70#
71# The following options will be read by the MySQL Server. Make sure that
72# you have installed the server correctly (see above) so it reads this
73# file.
74#
75# server_type=3
76[mysqld]
77
78# The next three options are mutually exclusive to SERVER_PORT below.
79# skip-networking
80# enable-named-pipe
81# shared-memory
82
83# shared-memory-base-name=MYSQL
84
85# The Pipe the MySQL Server will use
86# socket=MYSQL
87
88# The TCP/IP Port the MySQL Server will listen on
89port=3306
90
91# Path to installation directory. All paths are usually resolved relative to this.
92# basedir="C:/Program Files/MySQL/MySQL Server 8.0/"
93
94# Path to the database root
95datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data
96
97# The default character set that will be used when a new schema or table is
98# created and no character set is defined
99# character-set-server=
100
101# The default authentication plugin to be used when connecting to the server
102default_authentication_plugin=caching_sha2_password
103
104# The default storage engine that will be used when create new tables when
105default-storage-engine=INNODB
106
107# Set the SQL mode to strict
108sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
109
110# General and Slow logging.
111log-output=FILE
112
113general-log=0
114
115general_log_file="LAPTOP-AJBJ2E1P.log"
116
117slow-query-log=1
118
119slow_query_log_file="LAPTOP-AJBJ2E1P-slow.log"
120
121long_query_time=10
122
123# Error Logging.
124log-error="LAPTOP-AJBJ2E1P.err"
125
126# ***** Group Replication Related *****
127# Specifies the base name to use for binary log files. With binary logging
128# enabled, the server logs all statements that change data to the binary
129# log, which is used for backup and replication.
130log-bin="LAPTOP-AJBJ2E1P-bin"
131
132# ***** Group Replication Related *****
133# Sets the binary logging format, and can be any one of STATEMENT, ROW,
134# or MIXED. ROW is suggested for Group Replication.
135# binlog_format
136
137# ***** Group Replication Related *****
138# Causes the master to write a checksum for each event in the binary log.
139# binlog_checksum supports the values NONE (disabled) and CRC32.
140# The default is CRC32. When disabled (value NONE), the server verifies
141# that it is writing only complete events to the binary log by writing
142# and checking the event length (rather than a checksum) for each event.
143# NONE must be used with Group Replication.
144# binlog_checksum
145
146# ***** Group Replication Related *****
147# The base name for the relay log. The server creates relay log files in
148# sequence by adding a numeric suffix to the base name. If you specify this
149# option, the value specified is also used as the base name for the relay log
150# index file. Relay logs increase speed by using load-balancing between disks.
151# relay_log
152
153# ***** Group Replication Related *****
154# Specifies the server ID. For servers that are used in a replication topology,
155# you must specify a unique server ID for each replication server, in the
156# range from 1 to 2^32 - 1. “Unique” means that each ID must be different
157# from every other ID in use by any other replication master or slave.
158server-id=1
159
160# ***** Group Replication Related *****
161# The host name or IP address of the slave to be reported to the master
162# during slave registration. This value appears in the output of SHOW SLAVE HOSTS
163# on the master server. Leave the value unset if you do not want the slave to
164# register itself with the master.
165# report_host=0.0
166
167# ***** Group Replication Related *****
168# The TCP/IP port number for connecting to the slave, to be reported to the master during
169# slave registration. Set this only if the slave is listening on a nondefault port or if
170# you have a special tunnel from the master or other clients to the slave.
171report_port=3306
172
173# ***** Group Replication Related *****
174# This option specifies whether global transaction identifiers (GTIDs) are
175# used to identify transactions. ON must be used with Group Replication.
176# gtid_mode
177
178# ***** Group Replication Related *****
179# When enabled, the server enforces GTID consistency by allowing execution of
180# only statements that can be safely logged using a GTID. You must set this
181# option to ON before enabling GTID based replication.
182# enforce_gtid_consistency
183
184# ***** Group Replication Related *****
185# Whether updates received by a slave server from a master server should be
186# logged to the slave's own binary log. Binary logging must be enabled on
187# the slave for this variable to have any effect. ON must be used with
188# Group Replication.
189# log_slave_updates
190
191# ***** Group Replication Related *****
192# Determines whether the slave server logs master status and connection information
193# to an InnoDB table in the mysql database, or to a file in the data directory.
194# The TABLE setting is required when multiple replication channels are configured.
195# master_info_repository
196
197# ***** Group Replication Related *****
198# Determines whether the slave server logs its position in the relay logs to an InnoDB
199# table in the mysql database, or to a file in the data directory. The TABLE setting is
200# required when multiple replication channels are configured.
201# relay_log_info_repository
202
203# ***** Group Replication Related *****
204# Defines the algorithm used to hash the writes extracted during a transaction. If you
205# are using Group Replication, this variable must be set to XXHASH64 because the process
206# of extracting the writes from a transaction is required for conflict detection on all
207# group members.
208# transaction_write_set_extraction
209
210# NOTE: Modify this value after Server initialization won't take effect.
211lower_case_table_names=1
212
213# Secure File Priv.
214secure-file-priv=""
215
216# The maximum amount of concurrent sessions the MySQL server will
217# allow. One of these connections will be reserved for a user with
218# SUPER privileges to allow the administrator to login even if the
219# connection limit has been reached.
220max_connections=151
221
222# The number of open tables for all threads. Increasing this value
223# increases the number of file descriptors that mysqld requires.
224# Therefore you have to make sure to set the amount of open files
225# allowed to at least 4096 in the variable "open-files-limit" in
226# section [mysqld_safe]
227table_open_cache=2000
228
229# Maximum size for internal (in-memory) temporary tables. If a table
230# grows larger than this value, it is automatically converted to disk
231# based table This limitation is for a single table. There can be many
232# of them.
233tmp_table_size=22M
234
235# How many threads we should keep in a cache for reuse. When a client
236# disconnects, the client's threads are put in the cache if there aren't
237# more than thread_cache_size threads from before. This greatly reduces
238# the amount of thread creations needed if you have a lot of new
239# connections. (Normally this doesn't give a notable performance
240# improvement if you have a good thread implementation.)
241thread_cache_size=10
242
243#*** MyISAM Specific options
244# The maximum size of the temporary file MySQL is allowed to use while
245# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
246# If the file-size would be bigger than this, the index will be created
247# through the key cache (which is slower).
248myisam_max_sort_file_size=100G
249
250# The size of the buffer that is allocated when sorting MyISAM indexes
251# during a REPAIR TABLE or when creating indexes with CREATE INDEX
252# or ALTER TABLE.
253myisam_sort_buffer_size=36M
254
255# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
256# Do not set it larger than 30% of your available memory, as some memory
257# is also required by the OS to cache rows. Even if you're not using
258# MyISAM tables, you should still set it to 8-64M as it will also be
259# used for internal temporary disk tables.
260key_buffer_size=8M
261
262# Size of the buffer used for doing full table scans of MyISAM tables.
263# Allocated per thread, if a full scan is needed.
264read_buffer_size=64K
265
266read_rnd_buffer_size=256K
267
268#*** INNODB Specific options ***
269# innodb_data_home_dir=
270
271# Use this option if you have a MySQL server with InnoDB support enabled
272# but you do not plan to use it. This will save memory and disk space
273# and speed up some things.
274# skip-innodb
275
276# If set to 1, InnoDB will flush (fsync) the transaction logs to the
277# disk at each commit, which offers full ACID behavior. If you are
278# willing to compromise this safety, and you are running small
279# transactions, you may set this to 0 or 2 to reduce disk I/O to the
280# logs. Value 0 means that the log is only written to the log file and
281# the log file flushed to disk approximately once per second. Value 2
282# means the log is written to the log file at each commit, but the log
283# file is only flushed to disk approximately once per second.
284innodb_flush_log_at_trx_commit=1
285
286# The size of the buffer InnoDB uses for buffering log data. As soon as
287# it is full, InnoDB will have to flush it to disk. As it is flushed
288# once per second anyway, it does not make sense to have it very large
289# (even with long transactions).
290innodb_log_buffer_size=1M
291
292# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
293# row data. The bigger you set this the less disk I/O is needed to
294# access data in tables. On a dedicated database server you may set this
295# parameter up to 80% of the machine physical memory size. Do not set it
296# too large, though, because competition of the physical memory may
297# cause paging in the operating system. Note that on 32bit systems you
298# might be limited to 2-3.5G of user level memory per process, so do not
299# set it too high.
300innodb_buffer_pool_size=8M
301
302# Size of each log file in a log group. You should set the combined size
303# of log files to about 25%-100% of your buffer pool size to avoid
304# unneeded buffer pool flush activity on log file overwrite. However,
305# note that a larger logfile size will increase the time needed for the
306# recovery process.
307innodb_log_file_size=48M
308
309# Number of threads allowed inside the InnoDB kernel. The optimal value
310# depends highly on the application, hardware as well as the OS
311# scheduler properties. A too high value may lead to thread thrashing.
312innodb_thread_concurrency=17
313
314# The increment size (in MB) for extending the size of an auto-extend InnoDB system tablespace file when it becomes full.
315innodb_autoextend_increment=64
316
317# The number of regions that the InnoDB buffer pool is divided into.
318# For systems with buffer pools in the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency,
319# by reducing contention as different threads read and write to cached pages.
320innodb_buffer_pool_instances=8
321
322# Determines the number of threads that can enter InnoDB concurrently.
323innodb_concurrency_tickets=5000
324
325# Specifies how long in milliseconds (ms) a block inserted into the old sublist must stay there after its first access before
326# it can be moved to the new sublist.
327innodb_old_blocks_time=1000
328
329# It specifies the maximum number of .ibd files that MySQL can keep open at one time. The minimum value is 10.
330innodb_open_files=300
331
332# When this variable is enabled, InnoDB updates statistics during metadata statements.
333innodb_stats_on_metadata=0
334
335# 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
336# in a separate .ibd file, rather than in the system tablespace.
337innodb_file_per_table=1
338
339# 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.
340innodb_checksum_algorithm=0
341
342# The number of outstanding connection requests MySQL can have.
343# This option is useful when the main MySQL thread gets many connection requests in a very short time.
344# It then takes some time (although very little) for the main thread to check the connection and start a new thread.
345# The back_log value indicates how many requests can be stacked during this short time before MySQL momentarily
346# stops answering new requests.
347# You need to increase this only if you expect a large number of connections in a short period of time.
348back_log=80
349
350# If this is set to a nonzero value, all tables are closed every flush_time seconds to free up resources and
351# synchronize unflushed data to disk.
352# This option is best used only on systems with minimal resources.
353flush_time=0
354
355# The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use
356# indexes and thus perform full table scans.
357join_buffer_size=256K
358
359# The maximum size of one packet or any generated or intermediate string, or any parameter sent by the
360# mysql_stmt_send_long_data() C API function.
361max_allowed_packet=4M
362
363# If more than this many successive connection requests from a host are interrupted without a successful connection,
364# the server blocks that host from performing further connections.
365max_connect_errors=100
366
367# Changes the number of file descriptors available to mysqld.
368# You should try increasing the value of this option if mysqld gives you the error "Too many open files".
369open_files_limit=4161
370
371# If you see many sort_merge_passes per second in SHOW GLOBAL STATUS output, you can consider increasing the
372# sort_buffer_size value to speed up ORDER BY or GROUP BY operations that cannot be improved with query optimization
373# or improved indexing.
374sort_buffer_size=256K
375
376# The number of table definitions (from .frm files) that can be stored in the definition cache.
377# If you use a large number of tables, you can create a large table definition cache to speed up opening of tables.
378# The table definition cache takes less space and does not use file descriptors, unlike the normal table cache.
379# The minimum and default values are both 400.
380table_definition_cache=1400
381
382# Specify the maximum size of a row-based binary log event, in bytes.
383# Rows are grouped into events smaller than this size if possible. The value should be a multiple of 256.
384binlog_row_event_max_size=8K
385
386# If the value of this variable is greater than 0, a replication slave synchronizes its master.info file to disk.
387# (using fdatasync()) after every sync_master_info events.
388sync_master_info=10000
389
390# If the value of this variable is greater than 0, the MySQL server synchronizes its relay log to disk.
391# (using fdatasync()) after every sync_relay_log writes to the relay log.
392sync_relay_log=10000
393
394# If the value of this variable is greater than 0, a replication slave synchronizes its relay-log.info file to disk.
395# (using fdatasync()) after every sync_relay_log_info transactions.
396sync_relay_log_info=10000
397
398# Load mysql plugins at start."plugin_x ; plugin_y".
399# plugin_load
400
401# The TCP/IP Port the MySQL Server X Protocol will listen on.
402# loose_mysqlx_port=33060