Guest User

Untitled

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