blob: 39ed0224893897ef33d494b99bfa4889a428cd72 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001# Example MySQL config file for medium systems.
2#
3# This is for a system with memory 8G where MySQL plays
4# an important part, or systems up to 128M where MySQL is used together with
5# other programs (such as a web server)
6#
7# In this file, you can use all long options that a program supports.
8# If you want to know which options a program supports, run the program
9# with the "--help" option.
10
11# The following options will be passed to all MySQL clients
12##[client]
13##user = root
14##port = 3306
15##socket = //opt/app/mysql/mysql.sock
16
17# Here follows entries for some specific programs
18
19# The MySQL server
20[mysqld]
21##performance_schema
22
23slow_query_log =ON
24long_query_time =2
25slow_query_log_file =//var/lib/mysql/slow_query.log
26
27skip-external-locking
28explicit_defaults_for_timestamp = true
29skip-symbolic-links
30local-infile = 0
31key_buffer_size = 16M
32max_allowed_packet = 4M
33table_open_cache = 100
34sort_buffer_size = 512K
35net_buffer_length = 8K
36read_buffer_size = 256K
37read_rnd_buffer_size = 512K
38myisam_sort_buffer_size = 8M
39max_connections = 500
40lower_case_table_names = 1
41thread_stack = 256K
42thread_cache_size = 25
43query_cache_size = 8M
44query_cache_type = 0
45query_prealloc_size = 512K
46query_cache_limit = 1M
47
48# Password validation
49##plugin-load-add=simple_password_check.so
50##simple_password_check_other_characters=0
51
52# Audit Log settings
53plugin-load-add=server_audit.so
54server_audit=FORCE_PLUS_PERMANENT
55server_audit_file_path=//var/lib/mysql/audit.log
56server_audit_file_rotate_size=50M
57server_audit_events=CONNECT,QUERY,TABLE
58server_audit_logging=on
59
60# Don't listen on a TCP/IP port at all. This can be a security enhancement,
61# if all processes that need to connect to mysqld run on the same host.
62# All interaction with mysqld must be made via Unix sockets or named pipes.
63# Note that using this option without enabling named pipes on Windows
64# (via the "enable-named-pipe" option) will render mysqld useless!
65#
66#skip-networking
67
68# Replication Master Server (default)
69# binary logging is required for replication
70##log-bin=//var/lib/mysql/mysql-bin
71
72# binary logging format - mixed recommended
73binlog_format=row
74
75# required unique id between 1 and 2^32 - 1
76# defaults to 1 if master-host is not set
77# but will not function as a master if omitted
78
79# Replication Slave (comment out master section to use this)
80#
81# To configure this host as a replication slave, you can choose between
82# two methods :
83#
84# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
85# the syntax is:
86#
87# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
88# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
89#
90# where you replace <host>, <user>, <password> by quoted strings and
91# <port> by the master's port number (3306 by default).
92#
93# Example:
94#
95# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
96# MASTER_USER='joe', MASTER_PASSWORD='secret';
97#
98# OR
99#
100# 2) Set the variables below. However, in case you choose this method, then
101# start replication for the first time (even unsuccessfully, for example
102# if you mistyped the password in master-password and the slave fails to
103# connect), the slave will create a master.info file, and any later
104# change in this file to the variables' values below will be ignored and
105# overridden by the content of the master.info file, unless you shutdown
106# the slave server, delete master.info and restart the slaver server.
107# For that reason, you may want to leave the lines below untouched
108# (commented) and instead use CHANGE MASTER TO (see above)
109#
110# required unique id between 2 and 2^32 - 1
111# (and different from the master)
112# defaults to 2 if master-host is set
113# but will not function as a slave if omitted
114#server-id = 2
115#
116# The replication master for this slave - required
117#master-host = <hostname>
118#
119# The username the slave will use for authentication when connecting
120# to the master - required
121#master-user = <username>
122#
123# The password the slave will authenticate with when connecting to
124# the master - required
125#master-password = <password>
126#
127# The port the master is listening on.
128# optional - defaults to 3306
129#master-port = <port>
130#
131# binary logging - not required for slaves, but recommended
132#log-bin=mysql-bin
133
134# Uncomment the following if you are using InnoDB tables
135##innodb_data_home_dir = //opt/app/mysql/data
136##innodb_data_file_path = ibdata1:20M:autoextend:max:32G
137##innodb_log_group_home_dir = //opt/app/mysql/iblogs
138# You can set .._buffer_pool_size up to 50 - 80 %
139# of RAM but beware of setting memory usage too high
140#innodb_buffer_pool_size = 6380M
141#innodb_additional_mem_pool_size = 2M
142# Set .._log_file_size to 25 % of buffer pool size
143innodb_log_file_size = 150M
144innodb_log_files_in_group = 3
145innodb_log_buffer_size = 8M
146#innodb_flush_log_at_trx_commit = 1
147innodb_lock_wait_timeout = 50
148innodb_autoextend_increment = 100
149expire_logs_days = 8
150open_files_limit = 2000
151transaction-isolation=READ-COMMITTED
152####### Galera parameters #######
153## Galera Provider configuration
154wsrep_provider=/usr/lib/galera/libgalera_smm.so
155wsrep_provider_options="gcache.size=2G; gcache.page_size=1G"
156## Galera Cluster configuration
157wsrep_cluster_name="MSO-automated-tests-cluster"
158wsrep_cluster_address="gcomm://"
159#wsrep_cluster_address="gcomm://mariadb1,mariadb2,mariadb3"
160##wsrep_cluster_address="gcomm://192.169.3.184,192.169.3.185,192.169.3.186"
161## Galera Synchronization configuration
162wsrep_sst_method=rsync
163#wsrep_sst_method=xtrabackup-v2
164#wsrep_sst_auth="sstuser:Mon#2o!6"
165## Galera Node configuration
166wsrep_node_name="mariadb1"
167##wsrep_node_address="192.169.3.184"
168wsrep_on=ON
169## Status notification
170#wsrep_notify_cmd=/opt/app/mysql/bin/wsrep_notify
171#######
172
173
174[mysqldump]
175quick
176max_allowed_packet = 16M
177
178[mysql]
179no-auto-rehash
180# Remove the next comment character if you are not familiar with SQL
181#safe-updates
182
183[myisamchk]
184key_buffer_size = 20971520
185
186##[mysqlhotcopy]
187##interactive-timeout
188##[mysqld_safe]
189##malloc-lib=//opt/app/mysql/local/lib/libjemalloc.so.1
190##log-error=//opt/app/mysql/log/mysqld.log
191
192general_log_file = /var/log/mysql/mysql.log
193general_log = 1