MariaDB of Mysql branch my. cnf profile Chinese annotation version

  • 2020-06-19 11:52:38
  • OfStack


# /usr/share/mysql/my-huge.cnf 
# MariaDB  The configuration file   The sample template (huge, The giant ).
#
#  This document applies to a dedicated database server ,  Memory for  1G-2G
#  The machine is mainly only running  MariaDB Large scale system  ,
#
# MariaDB  The program looks for the operating system platform on which it is running 1 Series of configuration files ,
#  You can copy this template configuration file to the appropriate location ( And rename ),
#  To see which profiles are read , perform :
# 'my_print_defaults --help'  And look at 
# Default options are read from the following files in the given order: 
# (-->  The program reads the listed configuration files in turn .)  This section lists the files below ( The path ) The list of .
#  Please refer to for more information : http://dev.mysql.com/doc/mysql/en/option-files.html
#
#  In various sections of this document , You can use all the options supported by the program .
#  If you want to know if your program supports a parameter ,
#  You can use   "--help"  Option to start the program , View Help information .
#  The following 1 The configuration options in the section are all local  MySQL  Client read , As default configuration 
[client]
#password = your_password
port  = 3306
socket  = /var/lib/mysql/mysql.sock
#  The following sections , The parsing is read by various applications 
# MySQL server  Configuration information 
[mysqld]
port  = 3306
socket  = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
#  Number of concurrent threads , Suggestions for CPU Core number times 2:  CPU's*2 for thread_concurrency
thread_concurrency = 8
#  You can specify 1 A path to a dedicated disk to serve as a temporary directory , For example,  SSD
#tmpdir  = /tmp/
#  Configuring this parameter does not start   TCP/IP  port   Listening to the . 
#  If all handlers are in the same place 1 Connect to a machine  mysqld,  This is a 1 It's a very safe thing to do ,
#  All the same  mysqld  Can only pass through Unix sockets  Or named pipeline (named pipes) complete .
#  Pay attention to , Use this option without turning it on Windows On the named pipe (named pipes),
# ( through  "enable-named-pipe"  Configuration items )  Will lead to  mysqld  Do not use !
#skip-networking
#  Primary server configuration options  Replication Master Server (default)
#  In master-slave replication , Need to rely on 2 Log into the system 
log-bin=mysql-bin
#  The requirement is for the entire master-slave replication cluster  1  to  2^32 - 1  Only between 1ID,  Or fail , Or a lot of error log information .
#  If it's not set  master-host, The default value is  1
#  But if I omit it , the (master) Don't take effect 
server-id = 1
#  Configuration options from server  Replication Slave ( You need to  master  Partially comment out , To use this part )
#
#  To configure the server as a slave (replication slave),
#  There are two options available  :
#
# 1)  through  CHANGE MASTER TO  The command  ( It is described in detail in the user's manual ) -
#     Syntax is as follows :
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#     You can take  <host>, <user>, <password>  Replace with a string enclosed in single quotes ,
#     will  <port>  Replace with  master  The port number  ( The default is  3306).
#
#    1 An example is shown below :
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
#  or :
#
# 2)  Set the following parameters .  However, , 1 Once you choose this way ,
#     When master slave replication is first started  ( Even if starting replication fails ,  Such as the wrong  master-password  password ,
#     Lead to  slave  Bad connection ), slave  Will be created 1 called  master.info  The file ,
#     If you modify this configuration file later (xxx.cnf) These parameters are below ,  Will be ignored ,
#     And continue to use  master.info  Contents of the file ,
#     Unless close  slave  The server ,  And then delete the file  master.info  And restart it  slaver server.
#     For this reason ,  You should not systematically modify the following parameters ( with  <>  Comment section ),
#     It USES  CHANGE MASTER TO ( The above scheme 1)
# 
#
#  The requirement is for the entire master-slave replication cluster  2  to  2^32 - 1  Only between 1ID, 
#  Or fail , Or a lot of error log information .
#  If it's set  master-host, The default value is  2
#  But if I omit it , It doesn't become  slave 
#server-id       = 2
#
#  this slave  Connectable  master. - required
#master-host     =   <hostname>
#
# slave Connect to the  master  It's required for authentication  username
# -  The user name is required ( It can also be specified at connection time )
#master-user     =   <username>
#
# slave Connect to the  master  It's required for authentication  password
# -  A password is required ( It can also be specified at connection time )
#master-password =   <password>
#
# master  The port number to listen on 
#  optional  -  The default is  3306
#master-port     =  <port>
#
#  open 2 Log into the system ,  for slave Slave servers are not required , But it is recommended to turn on 
#log-bin=mysql-bin
#
# 2 Base log format   -   recommended  mixed
#binlog_format=mixed
#  If you just use  InnoDB  table ,  Please uncomment the following options 
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql
#  If you just use  InnoDB, You can set the  .._buffer_pool_size  For physical memory  50 - 80 %
#  Beware of setting memory usage too high 
#innodb_buffer_pool_size = 384M
#  Attach the cache pool size 
#innodb_additional_mem_pool_size = 20M
#  Set up the  .._log_file_size  for   buffer pool size  the  25 %  Or so 
#innodb_log_file_size = 100M
#  Log cache size , Don't set it too big ,1 Seconds to refresh 1 time 
#innodb_log_buffer_size = 8M
#  The default 1, The transaction commits and flushes the log to the hard disk ;
#  Set to 2, Flush to the operating system cache , But the performance is much better , Set to  0  Transactions can be lost .
#innodb_flush_log_at_trx_commit = 1
#  Table the timeout release time for the deadlock , Unit s 
#innodb_lock_wait_timeout = 50
[mysqldump]
#  Quickly export to the output stream / The hard disk , Not cached in memory 
quick
#  Maximum packet limit 
max_allowed_packet = 16M
[mysql]
no-auto-rehash
#  If the  SQL Not familiar with , You can remove the comment below , Refused to no where Unsafe operation .
#safe-updates
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout


Related articles: