paulwong

          MYSQL經(jīng)典配置

          /etc/my.cnf

          [mysqld]
          datadir=/var/lib/mysql
          socket=/var/lib/mysql/mysql.sock
          #symbolic-links=0

          #vish start
          open_files_limit = 8000
          max_connections = 500
          #set-variable=max_connections=500
          thread_concurrency = 8
          #concurrent_insert=2
          thread_cache_size=2000

          interactive_timeout=180
          wait_timeout=180

          max_allowed_packet = 32M
          key_buffer_size = 3000M
          read_buffer_size = 16M
          read_rnd_buffer_size = 4M
          bulk_insert_buffer_size = 256M
          myisam_sort_buffer_size = 16M
          myisam_max_sort_file_size = 256M
          myisam_repair_threads = 1
          #myisam_recover = 4
          max_heap_table_size = 2048M
          tmp_table_size = 1024M
          table_open_cache = 2000
          table_cache = 2000
          sort_buffer_size = 128M 
          join_buffer_size = 128M 
          query_cache_size = 128M 
          query_cache_limit = 128M 

          #slow_query_log=1
          log-slow-queries
          long_query_time=2
          #log_queries_not_using_indexes=1
          slow_query_log_file = /var/log/mariadb/host_name-slow.log

          [mysqldump]
          user=root
          password=*********
          #max_allowed_packet = 1024M 

          [myisamchk] 
          key_buffer_size = 2500M 
          sort_buffer_size = 1024M 
          read_buffer = 32M
          write_buffer = 32M

          [innodb]
          innodb_buffer_pool_size=3G
          innodb_buffer_pool_instance=2
          innodb_additional_mem_pool_size=20M
          innodb_log_file_size= 512M
          innodb_log_buffer_size=16M
          innodb_flush_log_at_trx_commit=1
          innodb_thread_concurrency=16
          #innodb_read_io_threads=16
          #innodb_write_io_threads=16
          #innodb_io_capacity=2000
          #innodb_lock_wait_timeout=120

          innodb_flush_method=O_DIRECT
          #vish end

          [mysqld_safe]
          log-error=/var/log/mariadb/mariadb.log
          pid-file=/var/run/mariadb/mariadb.pid
          #!includedir /etc/my.cnf.d

          posted on 2020-08-07 18:01 paulwong 閱讀(301) 評論(0)  編輯  收藏 所屬分類: MYSQL

          主站蜘蛛池模板: 东海县| 余江县| 乌兰察布市| 怀柔区| 威海市| 威宁| 定陶县| 马尔康县| 基隆市| 绩溪县| 利津县| 维西| 定结县| 宜君县| 凭祥市| 宜城市| 武平县| 万载县| 常州市| 彭水| 门源| 凌云县| 庄河市| 广河县| 义乌市| 固阳县| 皋兰县| 吴江市| 南华县| 三台县| 东宁县| 韶山市| 临城县| 奉贤区| 江津市| 柯坪县| 罗城| 布尔津县| 怀化市| 柳州市| 南川市|