NoPaste

my.cnf

von ben89
Beschreibung:
Datenbankkonfiguration
Snippet erstellt:
01.01.2018 23:06:26
Snippet wird automatisch gelöscht:
Niemals

Dein Code:
  1. # MariaDB DATABASE server configuration file.
  2. #
  3. # You can copy this file TO one OF:
  4. # - "/etc/mysql/my.cnf" TO SET global options,
  5. # - "~/.my.cnf" TO SET user-specific options.
  6. #
  7. # One can USE ALL long options that the program supports.
  8. # Run program WITH --help to get a list of available options and with
  9. # --print-defaults to see which it would actually understand and use.
  10. #
  11. # FOR explanations see
  12. # http://dev.mysql.com/doc/mysql/en/server-system-VARIABLES.html
  13.  
  14. # This will be passed TO ALL mysql clients
  15. # It has been reported that passwords should be ENCLOSED WITH ticks/quotes
  16. # escpecially IF they contain "#" chars...
  17. # Remember TO edit /etc/mysql/debian.cnf WHEN changing the socket location.
  18. [client]
  19. port            = 3306
  20. socket          = /var/run/mysqld/mysqld.sock
  21.  
  22. # Here IS entries FOR SOME specific programs
  23. # The following VALUES assume you have at least 32M ram
  24.  
  25. # This was formally known AS [safe_mysqld]. BOTH versions are currently parsed.
  26. [mysqld_safe]
  27. socket          = /var/run/mysqld/mysqld.sock
  28. nice            = 0
  29.  
  30. [mysqld]
  31. #
  32. # * Basic Settings
  33. #
  34. USER            = mysql
  35. pid-file        = /var/run/mysqld/mysqld.pid
  36. socket          = /var/run/mysqld/mysqld.sock
  37. port            = 3306
  38. basedir         = /usr
  39. datadir         = /var/lib/mysql
  40. tmpdir          = /tmp
  41. lc_messages_dir = /usr/share/mysql
  42. lc_messages     = en_US
  43. skip-external-locking
  44. #
  45. # Instead OF skip-networking the DEFAULT IS now TO listen ONLY ON
  46. # localhost which IS more compatible AND IS NOT less secure.
  47. #bind-address           = 127.0.0.1
  48. #
  49. # * Fine Tuning
  50. #
  51.  
  52. innodb_use_native_aio = 0
  53.  
  54. innodb_file_per_table = 2
  55. innodb_buffer_pool_size         = 224G
  56.  innodb_buffer_pool_instances = 224
  57. # innodb_change_buffer_max_size = 50
  58.  
  59. innodb_write_io_threads = 64
  60. innodb_read_io_threads = 64
  61.  
  62. innodb_log_file_size            = 6G
  63. innodb_max_dirty_pages_pct = 0
  64.  innodb_page_cleaners = 32
  65.  innodb_purge_threads = 32
  66.  innodb_flush_neighbors = 0
  67. # innodb_page_size = 4k
  68.  
  69. innodb_log_buffer_size          = 64M
  70.  
  71. innodb_log_compressed_pages = OFF
  72.  
  73. innodb_lock_wait_timeout = 1800
  74. innodb_thread_concurrency = 0
  75. innodb_open_files       = 4000
  76. innodb_io_capacity      = 4000
  77. innodb_io_capacity_max  = 8000
  78.  
  79.  innodb_lru_scan_depth = 256
  80.  
  81.  innodb_flush_method    = O_DIRECT
  82. #innodb_defragment = 1
  83.  
  84.  performance_schema = ON
  85.  
  86. key_buffer_size         = 2048M
  87. join_buffer_size                = 512M
  88. max_allowed_packet      = 1024M
  89.  
  90. thread_stack            = 192K
  91. thread_cache_size       = 256
  92.  
  93. table_open_cache = 10000
  94. tmp_table_size = 128M
  95. max_heap_table_size = 64M
  96.  
  97. max_connections         = 1001
  98. connect_timeout         = 5
  99. wait_timeout            = 3600
  100. sort_buffer_size        = 4M
  101. bulk_insert_buffer_size = 16M
  102.  
  103.  innodb_flush_log_at_trx_commit = 2
  104. innodb_fast_shutdown  = 1
  105.  innodb_buffer_pool_dump_at_shutdown = 0
  106. #tx_isolation = READ-UNCOMMITTED
  107. transaction-isolation = READ-UNCOMMITTED
  108.  
  109. #
  110. # * MyISAM
  111. #
  112. # This replaces the startup script AND checks MyISAM TABLES IF needed
  113. # the FIRST TIME they are touched. ON error, make copy AND try a repair.
  114. myisam_recover_options = BACKUP
  115. key_buffer_size         = 128M
  116. #open-files-LIMIT       = 2000
  117. myisam_sort_buffer_size = 512M
  118. concurrent_insert       = 2
  119. read_buffer_size        = 2M
  120. read_rnd_buffer_size    = 1M
  121. #
  122. # * Query Cache Configuration
  123. #
  124. # Cache ONLY tiny RESULT sets, so we can fit more IN the query cache.
  125. query_cache_limit       = 256M
  126. query_cache_size        = 512M
  127. # FOR more WRITE intensive setups, SET TO DEMAND OR OFF
  128. #query_cache_type               = DEMAND
  129. #
  130. # * Logging AND Replication
  131. #
  132. # BOTH location gets rotated BY the cronjob.
  133. # Be aware that this log TYPE IS a performance killer.
  134. # AS OF 5.1 you can enable the log at runtime!
  135.  
  136. general_log_file        = /var/log/mysql/mysql.log
  137. general_log             = 1
  138. #
  139. # Error log - should be very few entries.
  140. #
  141. log_error = /var/log/mysql/error.log
  142. log_warnings            = 2
  143. #
  144. # Enable the slow query log TO see queries WITH especially long duration
  145. #slow_query_log[={0|1}]
  146. slow_query_log_file     = /var/log/mysql/mariadb-slow.log
  147. long_query_time = 10
  148. #log_slow_rate_limit    = 1000
  149. log_slow_verbosity      = query_plan
  150.  
  151. #log-queries-not-using-indexes
  152. #log_slow_admin_statements
  153. #
  154. # The following can be used AS easy TO replay backup logs OR FOR replication.
  155. # note: IF you are setting up a replication slave, see README.Debian about
  156. #       other settings you may need TO CHANGE.
  157. #server-id              = 1
  158. #report_host            = master1
  159. #auto_increment_increment = 2
  160. #auto_increment_offset  = 1
  161. #log_bin                        = /var/log/mysql/mariadb-bin
  162. #log_bin_index          = /var/log/mysql/mariadb-bin.index
  163. # NOT fab FOR performance, but safer
  164. #sync_binlog            = 1
  165. expire_logs_days        = 5
  166. max_binlog_size         = 1G
  167. # slaves
  168. #relay_log              = /var/log/mysql/relay-bin
  169. #relay_log_index        = /var/log/mysql/relay-bin.index
  170. #relay_log_info_file    = /var/log/mysql/relay-bin.info
  171. #log_slave_updates
  172. #read_only
  173. #
  174. # IF applications support it, this stricter sql_mode prevents SOME
  175. # mistakes LIKE inserting invalid dates etc.
  176.  
  177. sql_mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  178. #sql_mode               = NO_ENGINE_SUBSTITUTION,TRADITIONAL
  179.  
  180.  
  181. #
  182. # * Security Features
  183. #
  184. # READ the manual, too, IF you want chroot!
  185. # chroot = /var/lib/mysql/
  186. #
  187. # FOR generating SSL certificates I recommend the OpenSSL GUI "tinyca".
  188. #
  189. # ssl-ca=/etc/mysql/cacert.pem
  190. # ssl-cert=/etc/mysql/server-cert.pem
  191. # ssl-KEY=/etc/mysql/server-KEY.pem
  192.  
  193. #
  194. # * Galera-related settings
  195. #
  196. [galera]
  197. # Mandatory settings
  198. #wsrep_on=ON
  199. #wsrep_provider=
  200. #wsrep_cluster_address=
  201. binlog_format=mixed
  202. default_storage_engine=InnoDB
  203. #innodb_autoinc_lock_mode=2
  204. #
  205. # Allow server TO accept connections ON ALL interfaces.
  206. #
  207. #bind-address=0.0.0.0
  208. #
  209. # Optional setting
  210. #wsrep_slave_threads=1
  211. #innodb_flush_log_at_trx_commit=0
  212.  
  213. [mysqldump]
  214. quick
  215. quote-names
  216. max_allowed_packet      = 1024M
  217.  
  218. [mysql]
  219. #no-auto-rehash # faster START OF mysql but no tab completion
  220.  
  221. [isamchk]
  222. key_buffer              = 16M
  223.  
  224. #
  225. # * IMPORTANT: Additional settings that can override those FROM this file!
  226. #   The files must END WITH '.cnf', otherwise they'll be ignored.
  227. #
  228. !includedir /etc/mysql/conf.d/

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. Alternativ kannst du den gesamten Eintrag auch als Datei herunterladen.