MySql5.7 configuration file my.ini settings my.ini file path

mysql configuration file my.ini modify my-default.ini after the restart invalid, turned out to be the wrong path, record it:

 

windows operating system:

1. Since we use MySql, you need to modify the mysql my.ini configuration file.

2. 5.7 but mysql my.ini position is not in C: \ Program Files \ MySQL \ my-default.ini MySQL Server 5.7 this directory is not what we want:

3. If installed in the C drive: we have to enter C: \ ProgramData \ MySQL \ MySQL Server 5.7 directory to see my.ini this point you can modify the configuration it once!
----------------

 

# MySql5.7 my.ini profile settings
[Client]
Port = 3306
Socket = /tmp/mysql.sock
 
[mysqld]
####################### ######## basic settings #####################################
#Mysql service the unique number for each unique need mysql service Id
Server-ID. 1 =
 
# default service port number 3306
port = 3306
 
#mysql installation root
the basedir = / opt / mysql
 
#mysql data file location
DATADIR = / opt / mysql / data
 
# for example, load data infile temporary directory will be used
TMPDIR = / tmp
 
# set socke file directory
socket = /tmp/mysql.sock
 
# is mainly used for MyISAM storage engine, if multiple servers connected to a database it is recommended that the following annotation content
skip-external -locking
 
# can only check the IP address of the client login, not the host name
skip_name_resolve = 1
# database default character set, the mainstream character set support some special emoticons (special emoticons 4 bytes)
character-the sET-Server = utf8mb4
 
# Database corresponding to the character set number of sorting rules, and pay attention to the corresponding character-set-server
collation = utf8mb4_general_ci-Server
 
# set the client character set is connected mysql, to prevent distortion
init_connect = 'utf8mb4 the SET NAMES'
 
# sql statement on whether the case sensitive, 1 represents insensitive
lower_case_table_names = 1
 
# maximum number of connections
max_connections = 400
# the maximum number of errors connected to
the max_connect_errors = 1000
 
#timestamp If not declared nOT NULL, NULL values are allowed
explicit_defaults_for_timestamp = true
 
size #SQL packets sent, if BLOB proposed changes to the object. 1G
the max_allowed_packet 128M =
 
#MySQL connections are idle for more than a certain time (unit: second) will be forced to close
#MySQL wait_timeout default is 8 hours, interactive_timeout to validate the configuration parameters need to
interactive_timeout seconds = 1800
wait_timeout = 1800
 
# maximum internal memory temporary tables, set to 128M.
# For example, a large amount of data group by, might use temporary tables by the Order,
# exceeds this value will be written to disk IO system pressure increases
tmp_table_size = 134217728
max_heap_table_size = 134217728


 
## ---------------------------- user process to allocate memory settings BEGIN ------------ ----------------- ##
## session will be assigned to each parameter memory size
# for sequentially scanning the table, data read out is temporarily stored in the read_buffer_size, when the full buff or reading the data back to the previous caller
# general 128kb ~ 256kb, for MyISAM
#read_buffer_size = 131072
random access # table for, when reading sorted according to a non-indexed field can be used , #
generally 128kb ~ 256kb, for MyISAM
#read_rnd_buffer_size = 262144
used when #order by or by Group
# recommended to be adjusted to 2M, the latter observed adjustment
sort_buffer_size = 2097152
# generally no big database transaction, set to 1 ~ 2M, the default 32KB
binlog_cache_size = 524288
 
############################ log settings ############# #############################
# database error log files
log_error = error.log
 
# sql slow query log settings
slow_query_log = 1
slow_query_log_file = slow.log
# is not used to check the index sql
log_queries_not_using_indexes = 1
# for the log_queries_not_using_indexes opening, recording the frequency of slow sql, article number per minute recorded
log_throttle_queries_not_using_indexes = 5
# as effective when the library from the library copy in how to have slow sql will also be recorded
log_slow_slave_statements = 1
# slow query execution the number of seconds must reach this value can be recorded
long_query_time = 2
rows # retrieve this value must reach before being referred to as slow query
min_examined_row_limit = 100
 
saved #mysql binlog log file expiration time automatically deleted after expiration
expire_logs_days = 5
 
############################ from the master copy set ################## ######################
# open mysql binlog function
log-bin bin-MySQL =
#binlog recorded content manner, the recording operation of each line
binlog_format = rOW

# Take effect as from the library, to be cascaded replication, you need this parameter
log_slave_updates
 
# library take effect as from the relay log relay-log self-healing
relay_log_recovery = 1
 
# take effect as from the library, the master omitted from the copy of error
slave_skip_errors = ddl_exist_errors
 
## --- and the redo log relationship binlog ## --- provided the BEGIN
# (step 1) prepare dml SQL-related operations, and in the redo log buff persistent cache to disk
# (step 2 ) If the previous prepare successful, then continue the transaction log persistence to the binlog
# (step 3) If the previous success, then write a commit record in the redo log inside
# when innodb_flush_log_at_trx_commit and sync_binlog are 1 is the safest,
# mysqld service in case of a crash or crash the server host, binary log may be missing at most only a statement or a transaction.
# But are set to cause frequent operation io 1, this mode is the slowest way.
# When innodb_flush_log_at_trx_commit set to 0, mysqld process crash can cause the loss of a second on all transaction data.
# When innodb_flush_log_at_trx_commit set to 2, only in the case of an operating system crash or power down the system, all transaction data on a second it might be lost.
When #commit affairs, control redo log buff persistent disk 1 by default.
innodb_flush_log_at_trx_commit = 2
when #commit affairs, writes mysql binlog log control mode defaults to 0
#innodb_flush_log_at_trx_commit and sync_binlog both is 1, mysql most secure but the pressure on the performance and largest
sync_binlog = 1
## --- redo log and the binlog --- ## set relationship END
 
############################ Innodb set ############ ##############################
unit 8k # data block, default 16k, 16kCPU smaller pressure, 8k of the select high throughput
parameter values #innodb_page_size also affect the maximum index length, 8k 16k than the maximum index length smaller
#innodb_page_size = 8192
# general physical storage provided ~% 70% 60
innodb_buffer_pool_size. 1G =
 
default 16M after 5.7.6 #
#innodb_log_buffer_size = 16777216
# on the parameters for unix, linux, window directly comment this parameter. the default value is NULL
#O_DIRECT reduce conflicts between the operating system level VFS cache and buffer cache itself Innodb
innodb_flush_method = O_DIRECT
 
# this format supports compression, 5.7. after 7 to default values
= Barracuda innodb_file_format
 
#CPU multi-core processing is provided, assuming a two CPU core 4 is provided below
# multiple read, write and less can be set to 2: 6 ratio
innodb_write_io_threads = 4
innodb_read_io_threads = 4
 
# number of pages and improved flushing dirty inserted merged quantity, improving disk I / O processing capacity
# the default value of 200 (unit: p)
# can determine the value based on recent IOPS disk
innodb_io_capacity = 500
 
# to get locked greatest resource waiting time, default 50 seconds over the time will error reported as follows:
# eRROR 1205 (HY000): Lock the wait timeout exceeded number; Restarting the try Transaction
innodb_lock_wait_timeout = 30
 
# adjusting buffer pool page is read and used in the recent dump the percentage, by setting this parameter reduces the number of page dump
innodb_buffer_pool_dump_pct = 40
 
# set redolog file directory, redoLog specific operation contents recorded transaction
innodb_log_group_home_dir = / opt / MySQL / redolog /
 
# settings undoLog file directory, undoLog transaction for rollback
innodb_undo_directory = / opt / mysql / undolog /
 
# In innodb_log_group_home_dir in redoLog number of files, redoLog contents of the file is overwritten cycle.
= 3 innodb_log_files_in_group
 
# bigger MySql5.7 official recommended to set up, can be close to the size of innodb_buffer_pool_size
set the value before the # mysql downtime can lead to large recovery time is too long, and now the recovery has accelerated a lot
# reduce the value of the dirty data the frequency flushed to disk
# maximum innodb_log_file_size * innodb_log_files_in_group <= 512GB, single-file <= 256GB
innodb_log_file_size = 1024M
 
# set undoLog space occupied by the file can be recovered
undoLog MySql file before the # 5.7 has been unable to increase recycling
innodb_undo_log_truncate = 1
innodb_undo_tablespaces = . 3
innodb_undo_logs = 128
 
# 5.7.7 default on this parameter controls the maximum length of a separate index reaches 3072
#innodb_large_prefix. 1 =
 
# 5.7.8 defaults to 4, Inodb background cleanup work threads
#innodb_purge_threads. 4 =
 
# by setting the configuration parameters to innodb_thread_concurrency limit the number of concurrent threads,
# once the number of execution threads of this limit is reached, additional threads until the queue right, will be placed to sleep in a few microseconds to,
# Can be configured by setting parameters innodb_thread_sleep_delay sleep time
# The default value is 0, in the official doc, for use innodb_thread_concurrency also gives some suggestions:
# (1) If a workload, the number of concurrent user threads less than 64, is recommended to set = 0 the innodb_thread_concurrency;
# (2) if the workload has even more serious occasional peak, it is recommended to set = 128 the innodb_thread_concurrency,
### and through continuous decrease of this parameter, 96, 80, 64 and the like, until we found to provide the best performance of the number of threads
#innodb_thread_concurrency = 0
############################ other content settings ##### #####################################
[the mysqldump]
Quick
the max_allowed_packet = 128M
[MySQL]
NO-Auto -rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 256K
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
Interactive-timeout
[mysqld_safe]
# each process can increase the number of open files.
open-files-limit = 28192

Guess you like

Origin www.cnblogs.com/q149072205/p/11460566.html