본문 바로가기
조회 수 115 추천 수 0 댓글 0

단축키

Prev이전 문서

Next다음 문서

수정 삭제

단축키

Prev이전 문서

Next다음 문서

수정 삭제
Extra Form
마리아DB셋팅방법
리눅스 설치 후 버전이 계속 달라지면서 기본세팅값이 바뀐다.
아래 내용중에 필요한것만 찾아서 바꿔주면된다.
보통 검은색으로 BOLD처리한 내용위주로 바꿔주면된다.
최신내용의 conf에 없는 설정은 굳이 찾아서 넣어주지 않아도 잘 작동한다.
 
설정파일 위치: etc/mysql/mariadb.conf.d/50-server.cnf
 
# MariaDB database server configuration file.
#
# You can copy this file to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
 
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
 
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
 
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
 
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc_messages_dir = /usr/share/mysql
lc_messages = en_US
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
# Connection Config 
key_buffer = 128M
max_allowed_packet = 16M
table_open_cache = 1024
max_connections = 2048
max_connect_errors = 20000
sort_buffer_size = 2M
read_buffer_size = 2M
myisam_sort_buffer_size = 2M
thread_cache = 512
query_cache_size = 512M
query_cache_type = 1
thread_concurrency = 16
tmp_table_size = 128M
max_heap_table_size = 128M
skip-name-resolve
character-set-server=utf8
default-storage-engine=InnoDB
 
log_warnings = 2
#
# Enable the slow query log to see queries with especially long duration
slow_query_log          = 1
slow_query_log_file = /var/log/mysql/mariadb-slow.log
long_query_time         = 5
#log_slow_rate_limit = 1000
log_slow_verbosity = query_plan
 
#log-queries-not-using-indexes
#log_slow_admin_statements
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id = 1
#report_host = master1
#auto_increment_increment = 2
#auto_increment_offset = 1
log_bin = /var/log/mysql/mariadb-bin
log_bin_index = /var/log/mysql/mariadb-bin.index
# not fab for performance, but safer
#sync_binlog = 1
expire_logs_days = 1
max_binlog_size         = 100M
# slaves
#relay_log = /var/log/mysql/relay-bin
#relay_log_index = /var/log/mysql/relay-bin.index
#relay_log_info_file = /var/log/mysql/relay-bin.info
#log_slave_updates
#read_only
#
# If applications support it, this stricter sql_mode prevents some
# mistakes like inserting invalid dates etc.
#sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# you can't just change log file size, requires special procedure
#innodb_log_file_size = 50M
innodb_buffer_pool_size= 32G (메모리 총 용량의 70~80%를 넣는다. 이게 가장중요하다..)
innodb_additional_mem_pool_size=40M
innodb_write_io_threads = 16 (CPU코어 갯수)
innodb_read_io_threads = 16 (CPU코어 갯수)
innodb_thread_concurrency = 32 
innodb_flush_log_at_trx_commit = 1
innodb_log_file_size = 256M
innodb_log_buffer_size = 32M
innodb_log_files_in_group = 2
innodb_flush_method=O_DIRECT (새로고침)
innodb_lock_wait_timeout = 120 (짧게 줄이면 좋을것같다..이노디비의 특성상)
innodb_io_capacity = 3000 (SSD는 10000~20000정도가 적당할것 같다. HDD는 1000~5000)
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
 
#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
 
[mysqldump]
quick
quote-names
max_allowed_packet = 128M
 
[mysql]
#no-auto-rehash # faster start of mysql but no tab completion
 
[isamchk]
key_buffer = 16M
 
#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

 


List of Articles
번호 분류 제목 날짜 조회 수
공지 유머 🚨(뉴비필독) 전체공지 & 포인트안내 10 2024.11.04 26350
공지 이슈 URL만 붙여넣으면 끝! 임베드 기능 2025.01.21 20774
379937 유머     [이벤트] 증권플러스에서 공짜 비트코인 받기 file 2024.10.17 519
379936 유머     [이벤트] 증권플러스에서 공짜 비트코인 받기 file 2024.10.17 1688
379935 SNS   왕이보는 새로운 장을 탐험하기 위해 동굴 속으로 들어갑니다 2024.09.19 73
379934 ​ 지금은 지수예측이 무의미한 시기인듯.... ​ 시장은 강하다~~~!! ​ 2023.06.16 339
379933 유머  [이벤트] 증권플러스에서 공짜 비트코인 받기 file 2024.10.14 74
379932 Video📽  [입덕직캠] TXT 연준 직캠 4K 'Chasing That Feeling' (TXT YEONJUN FanCam 2023.10.19 file 2023.10.22 2323
379931  "남자 나이 33살이면 아저씨인가요?" 여초 반응 file 2024.02.09 273
379930  "외국인이죠?" 물어 보는 일본 식당 file 2024.05.12 32
379929 데이터  #슈퍼그럼요 응원법 💖 #우정! 힘들땐 어깨를 빌려줄게💖 2022.01.08 250
379928 사진  230504 MCD 공트 file 2023.05.05 365
379927  50년만에 국내 판매 중단되는 음료수. file 2022.06.17 831
379926 정보  NCT 해찬, 튀르키예·시리아 지진 복구 1억원 기부 "마음 아팠다"[공식] 2023.02.17 1783
379925 잡담  우리 영원한 막둥이 지헌아,헌이가 항상 플로버에게 보여주는 밝고 예쁜 모습들 file 2024.04.17 302
379924  이선균, 드리워진 어둠의 그림자 file 2023.10.28 1783
379923  인도네시아에서 인기라는 결혼식 file 2021.04.20 39
379922 `똥꼬빤다`의 유래 ㄷ..JPG file 2023.10.31 965
379921 `똥꼬빤다`의 유래.JPG file 2023.10.31 750
379920 잡담 `보안` 차별성 강조하는 애플…이번엔 M1 맥에 보안 최강 - 매일경제 - 매일경제 2023.03.27 80
379919 정보 `보안` 차별성 강조하는 애플…이번엔 M1 맥에 보안 최강 - 매일경제 - 매일경제 2021.02.21 726
379918 `여친, 부인 유흥업소 경력 확인해준다`...`X녀탐정` 다시 성행 file 2022.08.03 1081
379917 `원정유흥`다니는 2030... ??? file 2021.07.14 43
379916 `진짜`들의 단톡방에 들어간 평범한 오타쿠.jpg file 2022.04.07 356
379915 `청소` 남자 직원만 하는 건 부당해` vs `오랜 관행인데 어쩌라고` file 2023.08.26 546
379914 SNS ^^ 2023.07.31 332
379913 ^^ 1 2022.08.04 818
379912 잡담 ^^ 2022.01.19 38
379911 잡담 ^^7 file 2021.10.17 137
379910 ^_______^ 2023.07.08 23
379909 ^_______^ 2023.07.08 106
379908 데이터 ^웃음 히어로^ 'YENA(최예나)'의 'SMILEY (Feat. BIBI)' @220127 엠카운트다운 2022.01.27 41
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12665 Next
/ 12665