- 개인이 공부할떄 사용하는 my.cnf 파일이다.
- real Mysql을 참고했다.
- 각각의 섹션으로 나누어 사용이 가능하다.
[mysqld]
server-id = 1
user = mysql
# File Path Config
basedir = /opt/mariadb
datadir = /mariadb/data
tmpdir = /mariadb/TMP
log-bin = /mariadb/repl_log/binary_log
pid-file = /mariadb/mysqld.pid
open-files-limit = 65535 # 프로세스가 동시에 여는 파일 수
port = 3306
default_authentication_plugin = mysql_native_password
init_connect = SET collation_connection = utf8_unicode_ci
init_connect = SET NAMES utf8
character-set-server = utf8
collation-server = utf8_general_ci
max_connections = 150 # 커넥션
max_prepared_stmt_count = 16384
event-scheduler = ON
lower_case_table_names = 1
wait_timeout = 28800
interactive_timeout = 28800
max_allowed_packet = 64M # 네트워크 계층에서 받는 패킷의 요청값.
table_open_cache = 1024 # 테이블의 정보를 캐쉬에 저장.
thread_cache_size = 4
lc_messages = en_US
plugin_dir = /opt/mariadb/lib/plugin
skip-name-resolve
transaction-isolation = READ-COMMITTED # 하나의 트랜잭션에서 커밋 이후 읽을수 있다.
performance_schema = ON
expire_logs_days = 3 # 최대 3일 로그를 저장.
master_info_file = /mariadb/data/master.info
relay_log_info_file = /mariadb/data/relay-log.info
## Mysql logging
log-error = /mariadb/err/error.log
# Buffer size
sort_buffer_size = 128K
read_buffer_size = 128K
read_rnd_buffer_size = 256K
key_buffer_size = 8M
join_buffer_size = 256K
net_buffer_length = 16K
myisam_sort_buffer_size = 4M
# InnoDB settings
default-storage-engine = InnoDB
innodb_data_home_dir = /mariadb/data
innodb_buffer_pool_size = 1536M
innodb_buffer_pool_instances = 2
innodb_file_per_table = 1
innodb_log_file_size = 64M
innodb_log_files_in_group = 2
innodb_log_group_home_dir = /mariadb/data
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
innodb_doublewrite = 0
innodb_io_capacity = 300
innodb_io_capacity_max = 600
innodb_flush_neighbors = 0
innodb_adaptive_hash_index = 1
innodb_write_io_threads = 2
innodb_read_io_threads = 2
innodb_stats_auto_recalc = 1
# Binary Logging settings
sync_binlog = 1
binlog_cache_size = 32K
max_binlog_size = 50M
log-bin-trust-function-creators = 1
rpl_semi_sync_master_enabled = 1
rpl_semi_sync_master_timeout = 1000
binlog_format = row
binlog_row_image = minimal
[client]
port = 3306
default-character-set = utf8
[mysql]
no-auto-rehash
show-warnings
default-character-set = utf8
prompt = \\u@\\h:\\d\\_\\R:\\m:\\\\s>
pager = "less -n -i -F -X -E"
[mysqldump]
quick
max_allowed_packet = 64M
default-character-set = utf8
[mariabackup]
user = root
password = 1234