[client]
port=3306
socket=/var/lib/mysql/mysql.sock
[mysqld]
port=3306
socket=/var/lib/mysql/mysql.sock
datadir=/var/lib/mysql
pid-file=/var/lib/mysql/mysql.pid
log-error=/var/log/mysql.err
server-id=2
#偶數(shù)ID
auto_increment_offset=2
auto_increment_increment=2
#打開二進(jìn)制功能,MASTER主服務(wù)器必須打開此項(xiàng)
log-bin=mysql-bin
binlog-format=MIXED
#binlog_row_p_w_picpath,默認(rèn)值為FULL,表示記錄的是全部的binlog操作日志(僅在binlog_format=ROW時候生效)。此外binlog_row_p_w_picpath還可以是minimal,表示binlog記錄的就只是影響后的行。如此一來使用ROW格式就能節(jié)約很多的磁盤空間。
#binlog-row-p_w_picpath=minimal
#將復(fù)制事件寫入binlog,一臺服務(wù)器既做主庫又做從庫此選項(xiàng)必須要開啟
log-slave-updates=true
gtid-mode=on
enforce-gtid-consistency=true
master-info-repository=TABLE
relay-log-info-repository=TABLE
sync-master-info=1
slave-parallel-workers=0
sync_binlog=0
binlog-checksum=CRC32
master-verify-checksum=1
slave-sql-verify-checksum=1
binlog-rows-query-log_events=1
expire_logs_days=7
#binlog單文件最大值
max_binlog_size=512M
#忽略不同步主從的數(shù)據(jù)庫
replicate-ignore-db=mysql
replicate-ignore-db=information_schema
replicate-ignore-db=performance_schema
replicate-ignore-db=sys
max_connections=3000
max_connect_errors=30
#忽略應(yīng)用程序想要設(shè)置的其他字符集
skip-character-set-client-handshake
#連接時執(zhí)行的SQL
init-connect=‘SET NAMES utf8’
#服務(wù)端默認(rèn)字符集
character-set-server=utf8
#請求的最大連接時間
wait_timeout=1800
#和上一參數(shù)同時修改才會生效
interactive_timeout=1800
#sql模式
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
max_allowed_packet=10M
bulk_insert_buffer_size=8M
query_cache_type=1
query_cache_size=128M
query_cache_limit=4M
key_buffer_size=256M
read_buffer_size=16K
skip-name-resolve
slow_query_log=1
long_query_time=6
slow_query_log_file=/var/log/slow-query.log
innodb_flush_log_at_trx_commit=2
innodb_log_buffer_size=16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size=20M
sort_buffer_size=20M
read_buffer=2M
write_buffer=2M
[mysqlhotcopy]
interactive-timeout
[mysqldump]
quick
max_allowed_packet=16M文章來源:http://www.zghlxwxcb.cn/news/detail-556099.html
[mysqld_safe]文章來源地址http://www.zghlxwxcb.cn/news/detail-556099.html
到了這里,關(guān)于Mysql數(shù)據(jù)庫搭建互為主從mysqlB的配置文件的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!