Skip to content

Commit

Permalink
Merge pull request #28 from startersclan/enhancement/add-my.cnf-for-m…
Browse files Browse the repository at this point in the history
…ariadb

Enhancement: Add `my.cnf` for `mariadb`
  • Loading branch information
leojonathanoh authored Sep 30, 2022
2 parents 7716d80 + ab591c6 commit 74eddfc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
43 changes: 43 additions & 0 deletions config/db/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[client]
port=3306
default_character_set=utf8mb4

[mysql]
default_character_set=utf8mb4

[mysqldump]
default_character_set=utf8mb4
quick
quote_names
max_allowed_packet = 16M

[mysqld]
skip_name_resolve
character_set_client=utf8mb4
character_set_server=utf8mb4
collation_server=utf8mb4_unicode_ci
local_infile=0
innodb_strict_mode
innodb_file_per_table
# Size of each log file in a log group. You should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. However,
# note that a larger logfile size will increase the time needed for the
# recovery process.
innodb_log_file_size=8M

# The size of the buffer InnoDB uses for buffering log data. As soon as
# it is full, InnoDB will have to flush it to disk. As it is flushed
# once per second anyway, it does not make sense to have it very large
# (even with long transactions).
innodb_log_buffer_size=8M

# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system. Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
innodb_buffer_pool_size=32M
1 change: 1 addition & 0 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ services:
# - MARIADB_PASSWORD=mypassword # Uncomment this if you want to create a regular user
- MARIADB_DATABASE=bf2stats
volumes:
- ./config/db/my.cnf:/etc/my.cnf:ro
- db-volume:/var/lib/mysql
networks:
- bf2-network
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ services:
# - MARIADB_PASSWORD=admin # Uncomment this if you want to create a regular user
- MARIADB_DATABASE=bf2stats
volumes:
- ./config/db/my.cnf:/etc/my.cnf:ro
- db-volume:/var/lib/mysql
networks:
- bf2-network
Expand Down

0 comments on commit 74eddfc

Please sign in to comment.