MySQL 線上設定檔

來源:互聯網
上載者:User

標籤:mysql 設定檔詳解

第一個配置

[client]port            = 3306socket          = /tmp/mysql.sockdefault-character-set = utf8[mysqld]default-character-set = utf8user = mysqlport            = 3306socket          = /tmp/mysql.sockbasedir = /usr/local/mysqldatadir = /data/mysql/datalog-error = /data/mysql/mysql-error.logpid-file = /data/mysql/mysql.pidft_min_word_len = 1old-passwords = 1log_slave_updates = 1log-bin = /data/mysql/binlog/mysql-binbinlog_format = mixedbinlog_cache_size = 4Mmax_binlog_cache_size = 8Mmax_binlog_size = 1Gexpire_logs_days = 90binlog-ignore-db = mysqlbinlog-ignore-db = testbinlog-ignore-db = information_schemakey_buffer_size = 384Mread_buffer_size = 4Mread_rnd_buffer_size = 16Msort_buffer_size = 8Mjoin_buffer_size = 8Mthread_cache_size = 8query_cache_size = 32Mquery_cache_limit = 2Mquery_cache_min_res_unit = 2kthread_concurrency = 8table_cache = 614table_open_cache = 512open-files-limit = 10240back_log = 600max_connections = 5000max_connect_errors = 6000external-locking = FALSEmax_allowed_packet = 16Mdefault-storage-engine = MYISAMthread_stack = 256Ktransaction_isolation = REPEATABLE-READtmp_table_size = 256Mmax_heap_table_size = 512Mbulk_insert_buffer_size = 64Mmyisam_sort_buffer_size = 64Mmyisam_max_sort_file_size = 10Gmyisam_repair_threads = 1myisam_recoverlong_query_time = 2slow_query_logslow_query_log_file = /data/mysql/slow.logskip-lockingskip-name-resolveserver-id = 1innodb_additional_mem_pool_size = 16Minnodb_buffer_pool_size = 512Minnodb_data_file_path = ibdata1:10M:autoextendinnodb_file_io_threads = 4innodb_thread_concurrency = 8innodb_flush_log_at_trx_commit = 1innodb_log_buffer_size = 16Minnodb_log_file_size = 128Minnodb_log_files_in_group = 3innodb_max_dirty_pages_pct = 90innodb_lock_wait_timeout = 120innodb_file_per_table = 0[mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehashRemove the next comment character if you are not familiar with SQLsafe-updates[myisamchk]key_buffer_size = 256Msort_buffer_size = 256Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeout

第二個配置

[client]port= 5660socket= /tmp/mysql5660.sockcharacter_set_server = utf8[mysqld]port= 5660socket= /tmp/mysql5660.sockuser= mysqldatadir= /u2/mysql5660/databack_log = 500#skip-networking#skip-grant-tablescharacter_set_server = utf8max_connections = 300#max_user_connections = 1000gtid_mode=onenforce-gtid-consistency=1explicit_defaults_for_timestamp = 1thread_handling=pool-of-threadsthread_pool_oversubscribe=25#percona#innodb_recovery_update_relay_log=1skip_name_resolve=1max_connect_errors = 10240table_open_cache = 2048max_allowed_packet = 16Mbinlog_cache_size = 1Mmax_heap_table_size = 64Mread_buffer_size = 512kread_rnd_buffer_size = 16Msort_buffer_size = 512kjoin_buffer_size = 512kthread_cache_size = 64thread_concurrency = 32query_cache_size = 0#query_cache_limit = 2M#ft_min_word_len = 4#memlockthread_stack = 192K# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLEtransaction_isolation = READ-COMMITTEDtmp_table_size = 64Mlog-bin=/u2/mysql5660/logs/mysql-binmax_binlog_size=256Mbinlog_format=mixedlog_slave_updates#loglog_error = /u2/mysql5660/data/error.loglog_warningsslow_query_log#slow_query_log=/u2/mysql5660/data/slow.loglong_query_time = 1tmpdir = /u2/mysql5660/tmpserver-id = 115660key_buffer_size = 64Mbulk_insert_buffer_size = 64Mmyisam_sort_buffer_size = 128Mmyisam_max_sort_file_size = 10Gmyisam_repair_threads = 1myisam-recover-options# *** INNODB Specific options ***#innodb_additional_mem_pool_size = 16Minnodb_buffer_pool_size = 2Ginnodb_data_file_path = ibdata1:100M:autoextendinnodb_data_home_dir =/u2/mysql5660/datainnodb_file_per_table=1innodb_write_io_threads = 16innodb_read_io_threads = 16#innodb_force_recovery=1innodb_thread_concurrency = 0innodb_flush_log_at_trx_commit = 0#innodb_fast_shutdowninnodb_log_buffer_size = 16Minnodb_log_file_size = 256Minnodb_log_files_in_group = 3innodb_log_group_home_dir=/u2/mysql5660/datainnodb_max_dirty_pages_pct = 90innodb_flush_method=O_DIRECTinnodb_lock_wait_timeout = 10[mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehash# Only allow UPDATEs and DELETEs that use keys.#safe-updates[myisamchk]key_buffer_size = 512Msort_buffer_size = 512Mread_buffer = 8Mwrite_buffer = 8M[mysqlhotcopy]interactive-timeout[mysqld_safe]# Increase the amount of open files allowed per process. Warning: Make# sure you have set the global system limit high enough! The high value# is required for a large number of opened tablesopen-files-limit = 8192



本文出自 “鄭彥生” 部落格,請務必保留此出處http://467754239.blog.51cto.com/4878013/1544945

MySQL 線上設定檔

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.