您好,登錄后才能下訂單哦!
下文內(nèi)容主要給大家?guī)?lái)mysql配置文件參數(shù)簡(jiǎn)析,這里所講到的知識(shí),與書(shū)籍略有不同,都是億速云專(zhuān)業(yè)技術(shù)人員在與用戶(hù)接觸過(guò)程中,總結(jié)出來(lái)的,具有一定的經(jīng)驗(yàn)分享價(jià)值,希望給廣大讀者帶來(lái)幫助。
今晚要?jiǎng)?chuàng)建十幾套mysql數(shù)據(jù)庫(kù),貼一個(gè)mysql配置文件參數(shù)供參考:
cat /etc/my.cnf
[mysql]
#CLIENT #
port = 3307
socket = /data/mysql_3307/data/mysql.sock
default-character-set = utf8
#
[mysqld]
#
port = 3307
# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /data/mysql_3307/data/mysql.sock
pid-file = /data/mysql_3307/data/mysql.pid
character_set_server = utf8
#
# MyISAM #
key-buffer-size = 32M
myisam-recover-options = FORCE,BACKUP
#
# SAFETY #
max-connections = 100000
max-allowed-packet = 256M
max-connect-errors = 1000000
skip-name-resolve
sysdate-is-now = 1
lower_case_table_names = 1
explicit_defaults_for_timestamp = 1
symbolic-links = 0
#
# DATA STORAGE #
basedir = /usr/local/mysql
datadir = /data/mysql_3307/data
#
# BINARY LOGGING #
server-id = 56100
log-bin = /data/mysql_3307/data/mysql-bin
expire-logs-days = 14
sync-binlog = 1
log_bin_trust_function_creators = 1
transaction_isolation = READ-COMMITTED
# GITD MODE #
gtid_mode = ON
enforce-gtid-consistency = 1
binlog_cache_size = 4M
max_binlog_size = 1G
max_binlog_cache_size = 2G
#
# REPLICATION #
skip-slave-start = 0
relay-log = /data/mysql_3307/data/relay-bin
slave-net-timeout = 60
sync-master-info = 0
sync-relay-log = 0
sync-relay-log-info = 0
slave_pending_jobs_size_max = 256M
binlog_group_commit_sync_delay = 100000
#
#rpl_semi_sync_master_enabled=1
#rpl_semi_sync_master_timeout=10000# 表示10 second
#rpl_semi_sync_slave_enabled=1
#
slave-parallel-type = LOGICAL_CLOCK
slave-parallel-workers = 24
master_info_repository = TABLE
relay_log_info_repository = TABLE
relay_log_recovery = ON
# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
thread-cache-size = 300
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 4096
#
# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 5
innodb-log-file-size = 2048M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 300G
innodb_io_capacity = 10000
innodb_io_capacity_max = 20000
innodb_write_io_threads = 16
innodb_read_io_threads = 16
innodb_flush_neighbors = 0
innodb_buffer_pool_instances = 16
innodb_max_dirty_pages_pct = 75
# LOGGING #
log-error = /logs/mysql_3307/mysql-error.log
log_timestamps = SYSTEM
log-queries-not-using-indexes = 0
slow-query-log = 1
slow-query-log-file = /logs/mysql_3307/mysql-slow.log
long_query_time = 1
#
[mysqladmin]
port = 3307
socket = /data/mysql_3307/data/mysql.sock
[mysqldump]
port = 3307
socket = /data/mysql_3307/data/mysql.sock
#
[xtrabackup]
port = 3307
socket = /data/mysql_3307/data/mysql.sock
[mysqlbackup]
port = 3307
socket = /data/mysql_3307/data/mysql.sock
對(duì)于以上關(guān)于mysql配置文件參數(shù)簡(jiǎn)析,如果大家還有更多需要了解的可以持續(xù)關(guān)注我們億速云的行業(yè)推新,如需獲取專(zhuān)業(yè)解答,可在官網(wǎng)聯(lián)系售前售后的,希望該文章可給大家?guī)?lái)一定的知識(shí)更新。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。