Skip to content

Commit dfc110c

Browse files
committed
1 parent e34e1d7 commit dfc110c

File tree

1 file changed

+111
-77
lines changed

1 file changed

+111
-77
lines changed

root/defaults/my.cnf

Lines changed: 111 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,156 @@
1-
## custom configuration file, please be aware that changing options here may break things
1+
## custom configuration file based on https://github.com/just-containers/mariadb/blob/master/rootfs/etc/mysql/my.cnf
2+
## please be aware that changing options here may break things
3+
#
4+
# The MySQL database server configuration file.
5+
#
6+
# One can use all long options that the program supports.
7+
# Run program with --help to get a list of available options and with
8+
# --print-defaults to see which it would actually understand and use.
9+
#
10+
# For explanations see
11+
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
12+
13+
# This will be passed to all mysql clients
14+
# It has been reported that passwords should be enclosed with ticks/quotes
15+
# escpecially if they contain "#" chars...
16+
[client]
17+
port = 3306
18+
socket = /var/run/mysqld/mysqld.sock
19+
20+
default-character-set = utf8mb4
221

22+
# Here is entries for some specific programs
23+
# The following values assume you have at least 32M ram
24+
25+
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
326
[mysqld_safe]
4-
nice = 0
27+
socket = /var/run/mysqld/mysqld.sock
28+
nice = 0
529

630
[mysqld]
7-
character-set-server = utf8
8-
max_connections = 100
9-
connect_timeout = 5
10-
wait_timeout = 600
11-
max_allowed_packet = 16M
31+
#
32+
# * Basic Settings
33+
#
34+
user = abc
35+
pid-file = /var/run/mysqld/mysqld.pid
36+
socket = /var/run/mysqld/mysqld.sock
37+
port = 3306
38+
basedir = /usr
39+
datadir = /var/lib/mysql
40+
tmpdir = /tmp
41+
lc_messages_dir = /usr/share/mysql
42+
lc_messages = en_US
43+
skip-external-locking
44+
#
45+
# Instead of skip-networking the default is now to listen only on
46+
# localhost which is more compatible and is not less secure.
47+
#bind-address = 127.0.0.1
48+
#
49+
# * Fine Tuning
50+
#
51+
key_buffer_size = 128M
52+
max_connections = 100
53+
connect_timeout = 5
54+
wait_timeout = 600
55+
max_allowed_packet = 16M
1256
thread_cache_size = 128
13-
sort_buffer_size = 4M
14-
bulk_insert_buffer_size = 16M
15-
tmp_table_size = 32M
16-
max_heap_table_size = 32M
17-
binlog_format=mixed
57+
thread_stack = 192K
58+
sort_buffer_size = 4M
59+
bulk_insert_buffer_size = 16M
60+
tmp_table_size = 32M
61+
max_heap_table_size = 32M
62+
63+
character_set_server = utf8mb4
64+
collation_server = utf8mb4_general_ci
65+
transaction_isolation = READ-COMMITTED
66+
binlog_format = ROW
67+
1868
#
1969
# * MyISAM
2070
#
2171
# This replaces the startup script and checks MyISAM tables if needed
2272
# the first time they are touched. On error, make copy and try a repair.
23-
myisam_recover_options = BACKUP
24-
key_buffer_size = 128M
25-
#open-files-limit = 2000
26-
table_open_cache = 400
27-
myisam_sort_buffer_size = 512M
28-
concurrent_insert = 2
29-
read_buffer_size = 2M
30-
read_rnd_buffer_size = 1M
73+
myisam_recover = BACKUP
74+
#open-files-limit = 2000
75+
table_open_cache = 400
76+
#table_cache = 64
77+
#thread_concurrency = 10
78+
myisam_sort_buffer_size = 512M
79+
concurrent_insert = 2
80+
read_buffer_size = 2M
81+
read_rnd_buffer_size = 1M
3182
#
3283
# * Query Cache Configuration
3384
#
3485
# Cache only tiny result sets, so we can fit more in the query cache.
35-
query_cache_limit = 128K
36-
query_cache_size = 64M
86+
query_cache_limit = 128K
87+
query_cache_size = 64M
3788
# for more write intensive setups, set to DEMAND or OFF
38-
#query_cache_type = DEMAND
89+
query_cache_type = DEMAND
3990
#
4091
# * Logging and Replication
4192
#
93+
console = 1
4294
# Both location gets rotated by the cronjob.
4395
# Be aware that this log type is a performance killer.
4496
# As of 5.1 you can enable the log at runtime!
45-
#general_log_file = /config/log/mysql/mysql.log
4697
#general_log = 1
98+
#general_log_file = /config/log/mysql/mysql.log
4799
#
48-
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
100+
# Error log - should be very few entries.
49101
#
50-
# we do want to know about network errors and such
51-
log_warnings = 2
102+
log_warnings = 2
103+
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf
104+
#log_error = /config/log/mysql/mysql.log
52105
#
53106
# Enable the slow query log to see queries with especially long duration
54-
#slow_query_log[={0|1}]
55-
slow_query_log_file = /config/log/mysql/mariadb-slow.log
56-
long_query_time = 10
57-
#log_slow_rate_limit = 1000
58-
log_slow_verbosity = query_plan
59-
107+
slow_query_log = 1
108+
slow_query_log_file = /config/log/mysql/mariadb-slow.log
109+
long_query_time = 5
110+
#log_slow_rate_limit = 1000
60111
#log-queries-not-using-indexes
61112
#log_slow_admin_statements
62113
#
63114
# The following can be used as easy to replay backup logs or for replication.
64-
# note: if you are setting up a replication slave, see README.Debian about
65-
# other settings you may need to change.
66-
#server-id = 1
67-
#report_host = master1
115+
# note: if you are setting up a replication slave, see
116+
# https://mariadb.com/kb/en/setting-up-replication/
117+
# about other settings you may need to change.
118+
#server-id = 1
119+
#report_host = master1
68120
#auto_increment_increment = 2
69-
#auto_increment_offset = 1
70-
log_bin = /config/log/mysql/mariadb-bin
71-
log_bin_index = /config/log/mysql/mariadb-bin.index
121+
#auto_increment_offset = 1
122+
log_bin = /config/log/mysql/mariadb-bin
123+
log_bin_index = /config/log/mysql/mariadb-bin.index
72124
# not fab for performance, but safer
73-
#sync_binlog = 1
74-
expire_logs_days = 10
125+
#sync_binlog = 1
126+
#binlog_do_db = include_database_name
127+
#binlog_ignore_db = include_database_name
128+
expire_logs_days = 10
75129
max_binlog_size = 100M
76130
# slaves
77-
#relay_log = /config/log/mysql/relay-bin
78-
#relay_log_index = /config/log/mysql/relay-bin.index
79-
#relay_log_info_file = /config/log/mysql/relay-bin.info
131+
#relay_log = /config/log/mysql/relay-bin
132+
#relay_log_index = /config/log/mysql/relay-bin.index
133+
#relay_log_info_file = /config/log/mysql/relay-bin.info
80134
#log_slave_updates
81135
#read_only
82136
#
83137
# If applications support it, this stricter sql_mode prevents some
84138
# mistakes like inserting invalid dates etc.
85-
#sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL
139+
#sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL
86140
#
87141
# * InnoDB
88142
#
89143
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
90144
# Read the manual for more InnoDB related options. There are many!
91-
default_storage_engine = InnoDB
145+
default_storage_engine = InnoDB
92146
# you can't just change log file size, requires special procedure
93-
#innodb_log_file_size = 50M
94-
innodb_buffer_pool_size = 256M
95-
innodb_log_buffer_size = 8M
96-
innodb_file_per_table = 1
97-
innodb_open_files = 400
98-
innodb_io_capacity = 400
99-
innodb_flush_method = O_DIRECT
147+
#innodb_log_file_size = 50M
148+
innodb_buffer_pool_size = 256M
149+
innodb_log_buffer_size = 8M
150+
innodb_file_per_table = 1
151+
innodb_open_files = 400
152+
innodb_io_capacity = 400
153+
innodb_flush_method = O_DIRECT
100154
#
101155
# * Security Features
102156
#
@@ -109,33 +163,13 @@ innodb_flush_method = O_DIRECT
109163
# ssl-cert=/etc/mysql/server-cert.pem
110164
# ssl-key=/etc/mysql/server-key.pem
111165

112-
#
113-
# * Galera-related settings
114-
#
115-
[galera]
116-
# Mandatory settings
117-
#wsrep_on=ON
118-
#wsrep_provider=
119-
#wsrep_cluster_address=
120-
#binlog_format=row
121-
#default_storage_engine=InnoDB
122-
#innodb_autoinc_lock_mode=2
123-
#
124-
# Allow server to accept connections on all interfaces.
125-
#
126-
#bind-address=0.0.0.0
127-
#
128-
# Optional setting
129-
#wsrep_slave_threads=1
130-
#innodb_flush_log_at_trx_commit=0
131-
132166
[mysqldump]
133167
quick
134168
quote-names
135-
max_allowed_packet = 16M
169+
max_allowed_packet = 16M
136170

137171
[mysql]
138-
#no-auto-rehash # faster start of mysql but no tab completion
172+
#no-auto-rehash # faster start of mysql but no tab completition
139173

140174
[isamchk]
141-
key_buffer_size = 16M
175+
key_buffer = 16M

0 commit comments

Comments
 (0)