Database/Maria,Mysql
percona mysql을 docker로 설치하는 방법
1. 명령어 :
- 볼륨은 자기 서버 설정에 맞게 설정하면 됨
sudo docker run -d --name=percona-mysql --restart=always \
-p 3306:3306 \
-v /home/{user_id}/project/percona_mysql/data:/var/lib/mysql \
-v /home/{user_id}/project/percona_mysql/logs:/var/log/mysql \
-e MYSQL_ROOT_PASSWORD=root \
percona/percona-server
2. 추천하는 my.cnf 설정 :
- 해당 my.cnf는 docker에서 적용된 파일에 추가 설정을 붙인 것임
# Percona Server template configuration
#
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
[client]
default-character-set=utf8mb4
port = 3306
[mysql]
default-character-set=utf8mb4
[mysqld]
character-set-client-handshake = FALSE
collation-server = utf8mb4_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8mb4
default_storage_engine = InnoDB
innodb_buffer_pool_size = 1024M
innodb_log_file_size = 256M
innodb_log_buffer_size = 8M
innodb_file_per_table = 1
innodb_open_files = 400
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_stats_on_metadata = 0
innodb_io_capacity = 15000
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove the leading "# " to disable binary logging
# Binary logging captures changes between backups and is enabled by
# default. It's default setting is log_bin=binlog
# disable_log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
!includedir /etc/my.cnf.d
docker 설치 관련 참고 사이트 :
https://github.com/percona/percona-docker
https://docs.percona.com/percona-server/8.0/installation/docker.html
https://percona.community/blog/2023/02/23/exploring-databases-on-containers-with-mysql/
'Database > Maria,Mysql' 카테고리의 다른 글
WITH RECURSIVE (재귀 쿼리)의 정리 (0) | 2022.09.04 |
---|---|
join에서 where과 on의 차이, outer join에 대한 정리 (0) | 2022.08.30 |
WITH와 CTE를 이용한 재귀적 사용법 (재귀 쿼리) (0) | 2022.08.29 |
with와 CTE (common table expression) (0) | 2022.08.29 |
1. replication with mariaDB - MariaDB와 MySQL의 Replication은 다르다! (0) | 2022.01.25 |
댓글