Skip to content

Commit 33d86e7

Browse files
committed
add custom my.cnf to defaults folder
1 parent 0a0963d commit 33d86e7

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/lib/mysql && \
2424
mkdir -p /var/lib/mysql
2525

2626
#Adding Custom files
27+
COPY defaults/ /defaults/
2728
COPY init/ /etc/my_init.d/
2829
COPY services/ /etc/service/
2930
RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh

defaults/my.cnf

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
## custom configuration file, please be aware that changing options here may break things
2+
3+
[mysqld_safe]
4+
nice = 0
5+
6+
[mysqld]
7+
max_connections = 100
8+
connect_timeout = 5
9+
wait_timeout = 600
10+
max_allowed_packet = 16M
11+
thread_cache_size = 128
12+
sort_buffer_size = 4M
13+
bulk_insert_buffer_size = 16M
14+
tmp_table_size = 32M
15+
max_heap_table_size = 32M
16+
17+
#
18+
# * MyISAM
19+
#
20+
# This replaces the startup script and checks MyISAM tables if needed
21+
# the first time they are touched. On error, make copy and try a repair.
22+
myisam_recover = BACKUP
23+
key_buffer_size = 128M
24+
#open-files-limit = 2000
25+
table_open_cache = 400
26+
myisam_sort_buffer_size = 512M
27+
concurrent_insert = 2
28+
read_buffer_size = 2M
29+
read_rnd_buffer_size = 1M
30+
#
31+
# * Query Cache Configuration
32+
#
33+
# Cache only tiny result sets, so we can fit more in the query cache.
34+
query_cache_limit = 128K
35+
query_cache_size = 64M
36+
# for more write intensive setups, set to DEMAND or OFF
37+
#query_cache_type = DEMAND
38+
#
39+
# * Logging and Replication
40+
#
41+
# Both location gets rotated by the cronjob.
42+
# Be aware that this log type is a performance killer.
43+
# As of 5.1 you can enable the log at runtime!
44+
#general_log_file = /config/log/mysql/mysql.log
45+
#general_log = 1
46+
#
47+
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
48+
#
49+
# we do want to know about network errors and such
50+
log_warnings = 2
51+
#
52+
# Enable the slow query log to see queries with especially long duration
53+
#slow_query_log[={0|1}]
54+
slow_query_log_file = /config/log/mysql/mariadb-slow.log
55+
long_query_time = 10
56+
#log_slow_rate_limit = 1000
57+
log_slow_verbosity = query_plan
58+
59+
#log-queries-not-using-indexes
60+
#log_slow_admin_statements
61+
#
62+
# The following can be used as easy to replay backup logs or for replication.
63+
# note: if you are setting up a replication slave, see README.Debian about
64+
# other settings you may need to change.
65+
#server-id = 1
66+
#report_host = master1
67+
#auto_increment_increment = 2
68+
#auto_increment_offset = 1
69+
log_bin = /config/log/mysql/mariadb-bin
70+
log_bin_index = /config/log/mysql/mariadb-bin.index
71+
# not fab for performance, but safer
72+
#sync_binlog = 1
73+
expire_logs_days = 10
74+
max_binlog_size = 100M
75+
# slaves
76+
#relay_log = /config/log/mysql/relay-bin
77+
#relay_log_index = /config/log/mysql/relay-bin.index
78+
#relay_log_info_file = /config/log/mysql/relay-bin.info
79+
#log_slave_updates
80+
#read_only
81+
#
82+
# If applications support it, this stricter sql_mode prevents some
83+
# mistakes like inserting invalid dates etc.
84+
#sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL
85+
#
86+
# * InnoDB
87+
#
88+
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
89+
# Read the manual for more InnoDB related options. There are many!
90+
default_storage_engine = InnoDB
91+
# you can't just change log file size, requires special procedure
92+
#innodb_log_file_size = 50M
93+
innodb_buffer_pool_size = 256M
94+
innodb_log_buffer_size = 8M
95+
innodb_file_per_table = 1
96+
innodb_open_files = 400
97+
innodb_io_capacity = 400
98+
innodb_flush_method = O_DIRECT
99+
#
100+
# * Security Features
101+
#
102+
# Read the manual, too, if you want chroot!
103+
# chroot = /var/lib/mysql/
104+
#
105+
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
106+
#
107+
# ssl-ca=/etc/mysql/cacert.pem
108+
# ssl-cert=/etc/mysql/server-cert.pem
109+
# ssl-key=/etc/mysql/server-key.pem
110+
111+
[mysqldump]
112+
quick
113+
quote-names
114+
max_allowed_packet = 16M
115+
116+
[mysql]
117+
#no-auto-rehash # faster start of mysql but no tab completition
118+
119+
[isamchk]
120+
key_buffer_size = 16M
121+
122+
123+

0 commit comments

Comments
 (0)