본문 바로가기
공부/리눅스 서버

[linux] MariaDB 10.6.10 install

by kyoung-ho 2022. 12. 15.
반응형
vi /etc/yum.repo.d/MariaDB.repo
------------------------------------------------------------------------------------------

# MariaDB 10.6 CentOS repository list - created 2022-11-01 08:21 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://tw1.mirror.blendbyte.net/mariadb/yum/10.6/centos7-amd64
gpgkey=https://tw1.mirror.blendbyte.net/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
------------------------------------------------------------------------------------------
yum makecache
yum install MariaDB-server MariaDB-client
------------------------------------------------------------------------------------------
vim /etc/my.cnf

[client]
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]
port = 3306
innodb_data_home_dir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
default-storage-engine=INNODB
skip-external-locking
skip-name-resolve
skip-host-cache
wait_timeout = 600
interactive_timeout = 1200
max_connections = 1024
max_connect_errors=999999999
slow-query-log=1
long_query_time=1
slow_query_log_file=/var/lib/mysql/log-slow-queries.log
max_allowed_packet = 128M

innodb_buffer_pool_size = 1G
innodb_log_buffer_size = 16M
innodb_lock_wait_timeout = 160
innodb_file_per_table=1

innodb_log_file_size = 512M
innodb_log_files_in_group=4

innodb_max_dirty_pages_pct = 30
innodb_flush_method = O_DIRECT
innodb_lock_wait_timeout = 120

innodb_doublewrite = ON


# parameter edit
query_cache_limit=128M
query_cache_size=64M
query_cache_type=1
thread_concurrency = 8
skip-external-locking
init_connect=SET collation_connection=utf8_unicode_ci
init_connect=SET NAMES 'utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci

log-bin=mysql-bin
sync_binlog = 1
binlog_cache_size=5M
max_binlog_size=250M
binlog_format=mixed
expire_logs_days=7
server-id=1

[mysqldump]
quick
max_allowed_packet = 16M
default-character-set=utf8

[mysql]
no-auto-rehash
default-character-set=utf8

[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M

[mysqlhotcopy]
interactive-timeout

------------------------------------------------------------------------------------------
systemctl start mariadb
systemctl status mariadb
systemctl enable mariadb

/usr/bin/mysqladmin -u root password '패스워드 설정'
반응형

댓글