Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. # Example MySQL config file for very large systems.
  2. #
  3. # This is for a large system with memory of 1G-2G where the system runs mainly
  4. # MySQL.
  5. #
  6. # You can copy this file to
  7. # /etc/my.cnf to set global options,
  8. # mysql-data-dir/my.cnf to set server-specific options (in this
  9. # installation this directory is /var/lib/mysql) or
  10. # ~/.my.cnf to set user-specific options.
  11. #
  12. # In this file, you can use all long options that a program supports.
  13. # If you want to know which options a program supports, run the program
  14. # with the "--help" option.
  15.  
  16. # The following options will be passed to all MySQL clients
  17. [client]
  18. #password = your_password
  19. port = 3306
  20. socket = /var/run/mysqld/mysqld.sock
  21.  
  22. # Here follows entries for some specific programs
  23.  
  24. # The MySQL server
  25. [mysqld]
  26. port = 3306
  27. socket = /var/run/mysqld/mysqld.sock
  28. max_connections=4000
  29. key_buffer_size = 6144M
  30. table_cache=
  31. max_allowed_packet = 1000M
  32. table_open_cache = 5000
  33. sort_buffer_size = 400M
  34. read_buffer_size = 400M
  35. read_rnd_buffer_size = 800M
  36. myisam_sort_buffer_size = 640M
  37. max_join_size=1000000
  38. max_sort_length=20
  39. record_buffer=32M
  40. thread_cache_size = 128
  41. query_cache_size = 3200M
  42. back_log = 120
  43. # Try number of CPU's*2 for thread_concurrency
  44. thread_concurrency = 16
  45. default-character-set=utf8
  46. character-set-server=utf8
  47. myisam_sort_buffer_size=1024М
  48. collation-server=utf8_general_ci
  49. init-connect="SET NAMES utf8"
  50. default-character-set=utf8
  51. character-set-server=utf8
  52. collation-server=utf8_general_ci
  53. init-connect="SET NAMES utf8"
  54. skip-character-set-client-handshake
  55. query_cache_limit = 1M
  56. net_read_timeout=12
  57. net_write_timeout=15
  58. wait_timeout=30
  59. tmp_table_size = 1500M
  60. max_heap_table_size = 1000M
  61. # Don't listen on a TCP/IP port at all. This can be a security enhancement,
  62. # if all processes that need to connect to mysqld run on the same host.
  63. # All interaction with mysqld must be made via Unix sockets or named pipes.
  64. # Note that using this option without enabling named pipes on Windows
  65. # (via the "enable-named-pipe" option) will render mysqld useless!
  66. #
  67. #skip-networking
  68.  
  69. # Replication Master Server (default)
  70. # binary logging is required for replication
  71. log-bin=mysql-bin
  72.  
  73. # required unique id between 1 and 2^32 - 1
  74. # defaults to 1 if master-host is not set
  75. # but will not function as a master if omitted
  76. server-id = 1
  77.  
  78. # Replication Slave (comment out master section to use this)
  79. #
  80. # To configure this host as a replication slave, you can choose between
  81. # two methods :
  82. #
  83. # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  84. # the syntax is:
  85. #
  86. # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
  87. # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
  88. #
  89. # where you replace <host>, <user>, <password> by quoted strings and
  90. # <port> by the master's port number (3306 by default).
  91. #
  92. # Example:
  93. #
  94. # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
  95. # MASTER_USER='joe', MASTER_PASSWORD='secret';
  96. #
  97. # OR
  98. #
  99. # 2) Set the variables below. However, in case you choose this method, then
  100. # start replication for the first time (even unsuccessfully, for example
  101. # if you mistyped the password in master-password and the slave fails to
  102. # connect), the slave will create a master.info file, and any later
  103. # change in this file to the variables' values below will be ignored and
  104. # overridden by the content of the master.info file, unless you shutdown
  105. # the slave server, delete master.info and restart the slaver server.
  106. # For that reason, you may want to leave the lines below untouched
  107. # (commented) and instead use CHANGE MASTER TO (see above)
  108. #
  109. # required unique id between 2 and 2^32 - 1
  110. # (and different from the master)
  111. # defaults to 2 if master-host is set
  112. # but will not function as a slave if omitted
  113. #server-id = 2
  114. #
  115. # The replication master for this slave - required
  116. #master-host = <hostname>
  117. #
  118. # The username the slave will use for authentication when connecting
  119. # to the master - required
  120. #master-user = <username>
  121. #
  122. # The password the slave will authenticate with when connecting to
  123. # the master - required
  124. #master-password = <password>
  125. #
  126. # The port the master is listening on.
  127. # optional - defaults to 3306
  128. #master-port = <port>
  129. #
  130. # binary logging - not required for slaves, but recommended
  131. #log-bin=mysql-bin
  132. #
  133. # binary logging format - mixed recommended
  134. #binlog_format=mixed
  135.  
  136. # Point the following paths to different dedicated disks
  137. #tmpdir = /tmp/
  138. #log-update = /path-to-dedicated-directory/hostname
  139.  
  140. # Uncomment the following if you are using InnoDB tables
  141. innodb_data_home_dir = /var/lib/mysql/
  142. innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
  143. innodb_log_group_home_dir = /var/lib/mysql/
  144. # You can set .._buffer_pool_size up to 50 - 80 %
  145. # of RAM but beware of setting memory usage too high
  146. innodb_buffer_pool_size = 12000M
  147. innodb_additional_mem_pool_size = 20M
  148. # Set .._log_file_size to 25 % of buffer pool size
  149. innodb_log_file_size = 3000M
  150. innodb_log_buffer_size = 8M
  151. innodb_flush_log_at_trx_commit = 1
  152. innodb_lock_wait_timeout = 50
  153.  
  154. [mysqldump]
  155. quick
  156. max_allowed_packet = 16M
  157.  
  158. [mysql]
  159. no-auto-rehash
  160. # Remove the next comment character if you are not familiar with SQL
  161. #safe-updates
  162.  
  163. [myisamchk]
  164. key_buffer_size = 2560M
  165. sort_buffer_size = 2560M
  166. read_buffer = 20M
  167. write_buffer = 20M
  168.  
  169. [mysqlhotcopy]
  170. interactive-timeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement