千家信息网

MySQL中my.cnf配置文件的示例分析

发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,这篇文章主要为大家展示了"MySQL中my.cnf配置文件的示例分析",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"MySQL中my.cnf配置文件的示例分
千家信息网最后更新 2025年01月20日MySQL中my.cnf配置文件的示例分析

这篇文章主要为大家展示了"MySQL中my.cnf配置文件的示例分析",内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下"MySQL中my.cnf配置文件的示例分析"这篇文章吧。

  1. [client]

  2. default-character-set = utf8mb4

  3. port = PORT

  4. socket = /srv/myPORT/run/mysql.sock


  5. [mysqld]

  6. user = mysql

  7. port = PORT

  8. extra-port = 1PORT

  9. character_set_server = utf8mb4

  10. server_id = SERVER_ID

  11. socket = /srv/myPORT/run/mysql.sock

  12. basedir = /opt/percona-server

  13. datadir = /srv/myPORT/data

  14. log-error = /srv/myPORT/log/alert.log

  15. pid-file = /srv/myPORT/run/mysql.pid

  16. log_slave_updates = 1

  17. log-bin = /srv/myPORT/log/mysql-bin

  18. binlog_format = row

  19. binlog_cache_size = 2M

  20. max_binlog_cache_size = 4G

  21. max_binlog_size = 1G

  22. expire_logs_days = 7

  23. relay-log = /srv/myPORT/log/relay-bin

  24. relay-log-info-file = /srv/myPORT/log/relay-log.info

  25. relay-log-index = /srv/myPORT/log/relay-log.index

  26. master-info-file = /srv/myPORT/log/master.info

  27. relay-log-recovery = true

  28. sync-relay-log-info = 1

  29. explicit_defaults_for_timestamp

  30. key_buffer_size = 2M

  31. sort_buffer_size = 2M

  32. read_buffer_size = 2M

  33. read_rnd_buffer_size = 16M

  34. join_buffer_size = 2M

  35. thread_cache_size = 1024

  36. query_cache_size = 1M

  37. query_cache_limit = 1M

  38. query_cache_min_res_unit = 2k

  39. table_open_cache = 2048

  40. open_files_limit = 65535

  41. back_log = 3000

  42. max_connections = 4000

  43. max_user_connections = 2500

  44. max_connect_errors = 100

  45. max_allowed_packet = 512M

  46. thread_stack = 192k

  47. default-storage-engine = INNODB

  48. transaction_isolation = READ-COMMITTED

  49. tmp_table_size = 16M

  50. max_heap_table_size = 64M

  51. bulk_insert_buffer_size = 64M

  52. long_query_time = 0.5

  53. slow_query_log = on

  54. slow_query_log_file = /srv/myPORT/log/slow.log

  55. skip-name-resolve

  56. innodb_buffer_pool_size = 10G

  57. innodb_data_file_path = ibdata1:2G:autoextend

  58. innodb_file_io_threads = 24

  59. innodb_purge_threads = 12

  60. innodb_read_io_threads = 24

  61. innodb_write_io_threads = 24

  62. innodb_thread_concurrency = 24

  63. innodb_buffer_pool_instances = 8

  64. innodb_flush_log_at_trx_commit= 1

  65. innodb_log_buffer_size = 16M

  66. innodb_log_file_size = 2G

  67. innodb_log_files_in_group = 2

  68. innodb_max_dirty_pages_pct = 75

  69. innodb_lock_wait_timeout = 50

  70. innodb_file_per_table = 1

  71. thread_handling = pool-of-threads

  72. thread_pool_idle_timeout = 180

  73. thread_pool_max_threads = 5000

  74. thread_pool_size = 24

  75. thread_pool_oversubscribe = 10

  76. thread_pool_stall_limit = 500

  77. [mysqldump]

  78. quick

  79. max_allow_packet = 64M

  80. [mysql]

  81. no-auto-rehash

  82. [mysqlhotcopy]

  83. interactive-timeout

以上是"MySQL中my.cnf配置文件的示例分析"这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!

0