Chinaunix首页 | 论坛 | 博客
  • 博客访问: 815556
  • 博文数量: 127
  • 博客积分: 3662
  • 博客等级: 中校
  • 技术积分: 1371
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-02 12:36
个人简介

Linux&MySQL&PHP&Nginx&Apache&MSSQL&Shell

文章分类

全部博文(127)

文章存档

2016年(1)

2015年(8)

2014年(14)

2013年(26)

2012年(17)

2011年(28)

2010年(33)

分类: Mysql/postgreSQL

2015-08-25 14:18:36


点击(此处)折叠或打开

  1. ------------------------------------------ 主库 DB01 MY.CNF -----------------------------------------------------------

  2. [mysqld]
  3. datadir=/data/mysql
  4. socket=/data/mysql/mysql.sock
  5. user=mysql

  6. #old_passwords=1

  7. # default
  8. character-set-server=utf8
  9. default-storage-engine=INNODB

  10. skip-slave-start
  11. skip-name-resolve

  12. # buffer cache
  13. max_connections = 10000
  14. key_buffer_size = 256M
  15. myisam_sort_buffer_size = 64M
  16. join_buffer_size = 8M
  17. read_buffer_size = 4M
  18. sort_buffer_size = 8M
  19. table_cache = 2048
  20. interactive_timeout = 1000
  21. innodb_buffer_pool_size = 8G

  22. tmp_table_size = 256M

  23. # max
  24. max_allowed_packet = 60M
  25. max_connect_errors = 10
  26. max_heap_table_size = 256M

  27. # query
  28. query_cache_limit = 1M
  29. query_cache_size = 64M
  30. query_cache_type = 1

  31. # thread
  32. #thread_cache = 24
  33. thread_cache_size = 196
  34. thread_concurrency = 16
  35. group_concat_max_len = 10240
  36. back_log = 50
  37. wait_timeout = 600

  38. # log
  39. slow-query-log=ON
  40. slow-query-log-file=/var/log/slow-queries.log
  41. long_query_time=5
  42. log-slow-admin-statements
  43. log-queries-not-using-indexes
  44. #log_queries_not_using_indexes
  45. #log-slow-admin-statements

  46. #log=/var/log/queries_log.log
  47. log-error=/var/log/mysqld.log
  48. #log-queries-not-using-indexes=1
  49. #long_query_time = 5

  50. ft_min_word_len = 2

  51. expire_logs_days = 5

  52. log-bin=mysql-bin
  53. log_bin = /data/mysql/mysql-bin.log
  54. log_bin_index = /data/mysql/mysql-bin.log.index
  55. log-bin-trust-function-creators=1

  56. max_binlog_size=1024M
  57. #binlog_format=mixed
  58. server-id = 1
  59. #binlog-ignore-db=forums_games_la

  60. #innodb_log_file_size = 256M
  61. #innodb_log_buffer_size = 4M
  62. #innodb_flush_method = O_DIRECT
  63. #innodb_flush_log_at_trx_commit = 1

  64. [client]
  65. default-character-set=utf8

  66. [mysqld_safe]
  67. open_files_limit = 8192
  68. log-error=/var/log/mysqld.log
  69. #pid-file=/var/run/mysqld/mysqld.pid


点击(此处)折叠或打开

  1. ------------------------------------------ 从库 DB02 MY.CNF -----------------------------------------------------------

  2. [mysqld]
  3. datadir=/data/mysql
  4. socket=/data/mysql/mysql.sock
  5. user=mysql

  6. #old_passwords=1

  7. # default
  8. character-set-server=utf8
  9. default-storage-engine=INNODB

  10. skip-name-resolve
  11. skip-slave-start
  12. #slave-skip-errors=all
  13. #slave-skip-errors=1062
  14. #slave-skip-errors=1062 126 144
  15. #slave-skip-errors=126

  16. # buffer cache
  17. max_connections = 10000
  18. key_buffer = 256M
  19. myisam_sort_buffer_size = 64M
  20. join_buffer_size = 8M
  21. read_buffer_size = 4M
  22. sort_buffer_size = 8M
  23. table_cache = 2048
  24. interactive_timeout = 1000
  25. innodb_buffer_pool_size = 8G

  26. # myisam
  27. myisam_sort_buffer_size = 128M
  28. myisam_max_sort_file_size = 30G
  29. myisam_repair_threads = 1
  30. myisam_recover

  31. tmp_table_size = 256M

  32. # max
  33. max_allowed_packet = 100M
  34. max_connect_errors = 10
  35. max_heap_table_size = 256M

  36. # query
  37. query_cache_limit = 1M
  38. query_cache_size = 64M
  39. query_cache_type = 1

  40. # thread
  41. thread_cache = 24
  42. thread_cache_size = 196
  43. thread_concurrency = 16

  44. back_log = 50
  45. wait_timeout = 600

  46. # log
  47. log_error=/var/log/mysqld.log

  48. slow-query-log=ON
  49. slow-query-log-file=/var/log/slow-queries.log
  50. long_query_time=5
  51. log-slow-admin-statements
  52. log-queries-not-using-indexes


  53. ft_min_word_len = 2

  54. expire_logs_days = 5

  55. log-bin=mysql-bin
  56. log_bin = /data/mysql/mysql-bin.log
  57. log_bin_index = /data/mysql/mysql-bin.log.index
  58. log-bin-trust-function-creators=1
  59. max_binlog_size=1024M
  60. server-id = 3838
  61. relay-log=/data/mysql/replicate
  62. relay-log-index=/data/mysql/replicate.index
  63. read-only=1
  64. #master-host = 10.68.38.42
  65. #master-user = slave
  66. #master-pass = wo2s8w2sWSk
  67. #master-port = 3306
  68. #master-connect-retry=60
  69. replicate-ignore-db=mysql
  70. log-slave-updates

  71. [client]
  72. default-character-set=utf8
  73. [mysqld_safe]
  74. open_files_limit = 8192
  75. log-error=/var/log/mysqld.log
  76. pid-file=/var/run/mysqld/mysqld.pid


阅读(833) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~