## MySQL Server Instance Configuration File Template ## ---------------------------------------------------------------------- ## Version 1.0.10 ## ## <-- Indicates Template comment. These lines will not be in the output ## ## Replaceable things must be like: ## ## # [VARIABLE_NAME]="Formula" ## parameter=default value ## ## For example: ## ## # [PORT]="port" ## port=3306 ## ## Note - In the example, the formula consists of a variable named 'port' which must be defined before processing. ## ## In addition to the standard max operators (+, -, /, *), the "formula" field supports the following functions: ## ## rnd(x, y) = Round x to the nearest y ## max(x, y) = Max value from x, y ## min(x, y) = Min value from x, y ## ## and named variables. ## ## For example: ## ## # [MAX_CONNECTIONS]="max_connections:rnd(max(100,max_connections),1000)" ## max_connections= ## ## ( Note - Uninitialized variables have a value of 0. ) ## ## Finally, there is a special directive named [STATE_CHANGE] that allows for a function to be exectuted at that ## point during template processing. ## ## For example: ## # [STATE_CHANGE]="new_variable : 1" ## ## The following variables must be defined before the formulas are evaluated (otherwise, you get many values set to 0): ## ## memory - Server Type ## Dedicated Server (90% of System Memory), Server (50% of System Memory), All others( rnd(max( 1/12 System Memory, 40*1024*1024), 1024)) ## myiasm_percentage - Table Type ## If main InnoDB, set to 5. Allow userdef. ## active_connections - # Connections. ## DSS = 20, OLTP = 500, else user_defined. ## cpus - Number of CPUS on the machine. ## # Other default tuning values ## ## innodb_buffer_pool_size_percentage=2/10 # [STATE_CHANGE]="over_commit_factor:10" ## ## # 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/5.6/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] # [CLIENT_PIPE]="" # pipe= # [CLIENT_SOCKET]="socket" # socket= # [CLIENT_PORT]="port" port=3306 [mysql] no-beep # [CLIENT_DEFAULT_CHARACTER_SET]="" # 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. # # [SERVER_TYPE]="server_type" # server_type= [mysqld] # The next three options are mutually exclusive to SERVER_PORT below. # [SERVER_SKIP]="" # skip-networking= # [SERVER_PIPE]="" # enable-named-pipe= # [SHARED_MEMORY]="" # shared-memory= # [SHARED_MEMORY_BASE_NAME]="shared_memory_base_name" # shared-memory-base-name= # The Pipe the MySQL Server will use # [SERVER_SOCKET]="socket" # socket= # [VERSION_MIN]="5.6.43" # The access control granted to clients on the named pipe created by the MySQL Server. # [NAMED_PIPE_FULL_ACCESS_GROUP]="named_pipe_full_access_group" # named-pipe-full-access-group= # The TCP/IP Port the MySQL Server will listen on # [SERVER_PORT]="port" port=3306 # Path to installation directory. All paths are usually resolved relative to this. # [BASE_DIR]="basedir" # basedir= # Path to the database root # [DATA_DIR]="datadir" datadir= # The default character set that will be used when a new schema or table is # created and no character set is defined # [SERVER_DEFAULT_CHARACTER_SET]="" # character-set-server= # The default storage engine that will be used when create new tables when # [DEFAULT_STORAGE_ENGINE]="default_storage_engine" default-storage-engine= # 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]="" sql-mode="NO_ENGINE_SUBSTITUTION" # General and Slow logging. # [LOG_OUT]="log_out" log-output= # [GEN_QUERY]="gen_query" general-log= # [GEN_QUERY_FILE]="gen_query_file" general_log_file= # [SLOW_QUERY]="slow_query" slow-query-log= # [SLOW_QUERY_FILE]="slow_query_file" slow_query_log_file= # [LONG_QUERY]="long_query_time" long_query_time= # Binary Logging. # [LOG_BIN]="log_bin" log-bin= # Error Logging. # [LOG_ERR]="log_error" log-error= # Server Id. # [SERVER_ID]="server_id" server-id= # 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]="lower_case_table_names" lower_case_table_names= # 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]="secure_file_priv" # secure-file-priv= # 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. # [DEFAULT]="max_connections:151" # [STATE_CHANGE]="max_connections:rnd(min(active_connections*15/10+10,memory/512K),1000)" # [MAX_CONNECTIONS]="max_connections:rnd(max(151,max_connections),1000)" max_connections= # Query cache is used to cache SELECT results and later return them # without actual executing the same query once again. Having the query # cache enabled may result in significant speed improvements, if your # have a lot of identical queries and rarely changing tables. See the # "Qcache_lowmem_prunes" status variable to check if the current value # is high enough for your load. # Note: In case your tables change very often or if your queries are # textually different every time, the query cache may result in a # slowdown instead of a performance improvement. # [STATE_CHANGE]="available_memory:max(0,memory-(max_connections*256K))" # [QUERY_CACHE_SIZE]="query_cache_size:min(~(min(cpus,3)-3),1)*1048576","USE_BYTES" query_cache_size= # The number of open tables for all threads. Increasing this value # increases the number of file descriptors that mysqld requires. # Therefore you have to make sure to set the amount of open files # allowed to at least 4096 in the variable "open-files-limit" in # section [mysqld_safe] # [STATE_CHANGE]="buffers_memory:available_memory*7/10" # [STATE_CHANGE]="thread_buffers_memory:available_memory*3/10" # [STATE_CHANGE]="memory_per_thread:thread_buffers_memory*over_commit_factor/max_connections" # [TABLE_CACHE]="table_open_cache:2000" table_open_cache= # 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. # [DEFAULT]="tmp_table_size:16M","USE_BYTES" # [STATE_CHANGE]="buffers_memory:buffers_memory-table_open_cache*8K" # [STATE_CHANGE]="big_thread_buffers:memory_per_thread*over_commit_factor" # [STATE_CHANGE]="tmp_table_size:max(16M,big_thread_buffers)" # [TMP_TABLE_SIZE]="tmp_table_size:min(tmp_table_size,memory*1/10)","USE_BYTES" tmp_table_size= #*** 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]="myisam_max_sort_file_size:2146435072" myisam_max_sort_file_size= # 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. # [DEFAULT]="myisam_sort_buffer_size:8M","USE_BYTES" # [STATE_CHANGE]="myisam_sort_buffer_size:max(8M,big_thread_buffers)" # [MYISAM_SORT_BUFFER_SIZE]="myisam_sort_buffer_size:min(myisam_sort_buffer_size,memory*2/10)","USE_BYTES" myisam_sort_buffer_size= # 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. # [DEFAULT]="key_buffer_size:8M","USE_BYTES" # [STATE_CHANGE]="myisam_buffers:buffers_memory*(myisam_percentage/100)" # [KEY_BUFFER_SIZE]="key_buffer_size:max(8M,myisam_buffers/2)","USE_BYTES" key_buffer_size= # 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. # [DEFAULT]="read_buffer_size:128K","USE_BYTES" # [STATE_CHANGE]="read_buffer_size:min(128K,memory_per_thread*2/100)" # [READ_BUFFER_SIZE]="read_buffer_size:min(read_buffer_size,memory/100)","USE_BYTES" read_buffer_size= # This variable is used for reads from MyISAM tables, and, for any storage engine, # for Multi-Range Read optimization. # [DEFAULT]="read_rnd_buffer_size:256K","USE_BYTES" # [STATE_CHANGE]="read_rnd_buffer_size:min(256K,memory_per_thread*4/10)" # [READ_RND_BUFFER_SIZE]="read_rnd_buffer_size:min(read_rnd_buffer_size,memory*4/100)","USE_BYTES" read_rnd_buffer_size= #*** INNODB Specific options *** # [INNODB_HOME]="" # 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] # skip-innodb # Additional memory pool that is used by InnoDB to store metadata # information. If InnoDB requires more memory for this purpose it will # start to allocate it from the OS. As this is fast enough on most # recent operating systems, you normally do not need to change this # value. SHOW INNODB STATUS will display the current amount used. # [STATE_CHANGE]="innodb_buffers:buffers_memory*(1-myisam_percentage/100)" # [STATE_CHANGE]="innodb_additional_mem_pool_size:max(2M,innodb_buffers*2/100)" # [INNODB_ADDITIONAL_MEM_POOL_SIZE]="innodb_additional_mem_pool_size:min(32M,innodb_additional_mem_pool_size)","USE_BYTES" innodb_additional_mem_pool_size= # 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]="innodb_log_buffer_size:8M","USE_BYTES" innodb_log_buffer_size= # 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]="innodb_buffer_pool_size:128M","USE_BYTES" innodb_buffer_pool_size= # Size of each log file in a log group. You should set the combined size # of log files to about 25%-100% of your buffer pool size to avoid # unneeded buffer pool flush activity on log file overwrite. However, # note that a larger logfile size will increase the time needed for the # recovery process. # [INNODB_LOG_FILE_SIZE]="innodb_log_file_size:48M","USE_BYTES" innodb_log_file_size= # 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. # [DEFAULT]="innodb_thread_concurrency:0" # [INNODB_THREAD_CONCURRENCY]="innodb_thread_concurrency:max(8,2*cpus+1)" innodb_thread_concurrency= # The increment size (in MB) for extending the size of an auto-extend InnoDB system tablespace file when it becomes full. # [INNODB_AUTOEXTEND_INCREMENT]="innodb_autoextend_increment:64" innodb_autoextend_increment= # 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. # [STATE_CHANGE]="innodb_buffer_pool_instances:rnd(innodb_buffer_pool_size/134217728,1)" # [INNODB_BUFFER_POOL_INSTANCES]="innodb_buffer_pool_instances:max((innodb_buffer_pool_instances*bitedness), 8)" innodb_buffer_pool_instances= # Determines the number of threads that can enter InnoDB concurrently. # [INNODB_CONCURRENCY_TICKETS]="innodb_concurrency_tickets:5000" innodb_concurrency_tickets= # 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]="innodb_old_blocks_time:1000" innodb_old_blocks_time= # When this variable is enabled, InnoDB updates statistics during metadata statements. # [INNODB_STATS_ON_METADATA]="innodb_stats_on_metadata:0" innodb_stats_on_metadata= # 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]="innodb_file_per_table:1" innodb_file_per_table= # 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]="innodb_checksum_algorithm:0" innodb_checksum_algorithm= # 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]="flush_time:0" flush_time= # 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]="join_buffer_size:256K","USE_BYTES" join_buffer_size= # 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]="max_allowed_packet:4M","USE_BYTES" max_allowed_packet= # 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]="max_connect_errors:100" max_connect_errors= # Changes the number of file descriptors available to mysqld. # You should try increasing the value of this option if mysqld gives you the error "Too many open files". # [OPEN_FILES_LIMIT]="open_files_limit:10+max_connections+table_open_cache*2" open_files_limit= # Set the query cache type. 0 for OFF, 1 for ON and 2 for DEMAND. # [QUERY_CACHE_TYPE]="query_cache_type:min(~(min(cpus,3)-3),1)" query_cache_type= # 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]="sort_buffer_size:256K","USE_BYTES" sort_buffer_size= # 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]="binlog_row_event_max_size:8192","USE_BYTES" binlog_row_event_max_size= # If the value of this variable is greater than 0, a replica synchronizes its master.info file to disk. # (using fdatasync()) after every sync_master_info events. # [SYNC_MASTER_INFO]="sync_master_info:10000" sync_master_info= # 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]="sync_relay_log:10000" sync_relay_log= # If the value of this variable is greater than 0, a replica synchronizes its relay-log.info file to disk. # (using fdatasync()) after every sync_relay_log_info transactions. # [SYNC_RELAY_LOG_INFO]="sync_relay_log_info:10000" sync_relay_log_info= # Load mysql plugins at start."plugin_x ; plugin_y". # [PLUGIN_LOAD]="plugin_load" plugin_load=