Skip to content

Commit 2189e98

Browse files
committed
add my.cnf
1 parent 264f590 commit 2189e98

1 file changed

Lines changed: 165 additions & 0 deletions

File tree

mysql/my.cnf

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Example MySQL config file for very large systems.
2+
#
3+
# This is for a large system with memory of 1G-2G where the system runs mainly
4+
# MySQL.
5+
#
6+
# MySQL programs look for option files in a set of
7+
# locations which depend on the deployment platform.
8+
# You can copy this option file to one of those
9+
# locations. For information about these locations, see:
10+
# http://dev.mysql.com/doc/mysql/en/option-files.html
11+
#
12+
# In this file, you can use all long options that a program supports.
13+
# If you want to know which options a program supports, run the program
14+
# with the "--help" option.
15+
16+
# The following options will be passed to all MySQL clients
17+
[client]
18+
#password = your_password
19+
port = 3306
20+
socket = /tmp/mysql.sock
21+
#default-character-set = utf8
22+
23+
# Here follows entries for some specific programs
24+
25+
# The MySQL server
26+
[mysqld]
27+
port = 3306
28+
server-id = 1
29+
socket = /tmp/mysql.sock
30+
#skip-external-locking
31+
#skip-name-resolve
32+
back_log = 384
33+
key_buffer_size = 128M
34+
max_allowed_packet = 10M
35+
thread_stack = 256k
36+
table_cache = 128k
37+
table_open_cache = 512
38+
sort_buffer_size = 3M
39+
read_buffer_size = 3M
40+
join_buffer_size = 3M
41+
read_rnd_buffer_size = 8M
42+
myisam_sort_buffer_size = 64M
43+
table_cache = 512
44+
thread_cache_size = 64
45+
query_cache_size = 64M
46+
tmp_table_size = 128M
47+
max_connections = 768
48+
max_connect_errors = 10000000
49+
wait_timeout = 6
50+
log = /var/log/mysql/mysqld_common.log
51+
log-error = /var/log/mysql/mysqld_error.log
52+
#log-bin = /var/log/mysql/mysqld_bin.log
53+
log-slow-queries = /var/log/mysql/mysqld_slow.log
54+
long-query-time = 6
55+
#bind-address = 192.168.9.224
56+
character-set-server = utf8
57+
# Try number of CPU's*2 for thread_concurrency
58+
thread_concurrency = 8
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=mysql-bin
71+
72+
# required unique id between 1 and 2^32 - 1
73+
# defaults to 1 if master-host is not set
74+
# but will not function as a master if omitted
75+
server-id = 1
76+
77+
# Replication Slave (comment out master section to use this)
78+
#
79+
# To configure this host as a replication slave, you can choose between
80+
# two methods :
81+
#
82+
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
83+
# the syntax is:
84+
#
85+
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
86+
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
87+
#
88+
# where you replace <host>, <user>, <password> by quoted strings and
89+
# <port> by the master's port number (3306 by default).
90+
#
91+
# Example:
92+
#
93+
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
94+
# MASTER_USER='joe', MASTER_PASSWORD='secret';
95+
#
96+
# OR
97+
#
98+
# 2) Set the variables below. However, in case you choose this method, then
99+
# start replication for the first time (even unsuccessfully, for example
100+
# if you mistyped the password in master-password and the slave fails to
101+
# connect), the slave will create a master.info file, and any later
102+
# change in this file to the variables' values below will be ignored and
103+
# overridden by the content of the master.info file, unless you shutdown
104+
# the slave server, delete master.info and restart the slaver server.
105+
# For that reason, you may want to leave the lines below untouched
106+
# (commented) and instead use CHANGE MASTER TO (see above)
107+
#
108+
# required unique id between 2 and 2^32 - 1
109+
# (and different from the master)
110+
# defaults to 2 if master-host is set
111+
# but will not function as a slave if omitted
112+
#server-id = 2
113+
#
114+
# The replication master for this slave - required
115+
#master-host = <hostname>
116+
#
117+
# The username the slave will use for authentication when connecting
118+
# to the master - required
119+
#master-user = <username>
120+
#
121+
# The password the slave will authenticate with when connecting to
122+
# the master - required
123+
#master-password = <password>
124+
#
125+
# The port the master is listening on.
126+
# optional - defaults to 3306
127+
#master-port = <port>
128+
#
129+
# binary logging - not required for slaves, but recommended
130+
#log-bin=mysql-bin
131+
#
132+
# binary logging format - mixed recommended
133+
#binlog_format=mixed
134+
135+
# Uncomment the following if you are using InnoDB tables
136+
#innodb_data_home_dir = /data/mysql
137+
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
138+
#innodb_log_group_home_dir = /data/mysql
139+
# You can set .._buffer_pool_size up to 50 - 80 %
140+
# of RAM but beware of setting memory usage too high
141+
#innodb_buffer_pool_size = 384M
142+
#innodb_additional_mem_pool_size = 20M
143+
# Set .._log_file_size to 25 % of buffer pool size
144+
#innodb_log_file_size = 100M
145+
#innodb_log_buffer_size = 8M
146+
#innodb_flush_log_at_trx_commit = 1
147+
#innodb_lock_wait_timeout = 50
148+
149+
[mysqldump]
150+
quick
151+
max_allowed_packet = 16M
152+
153+
[mysql]
154+
auto-rehash
155+
# Remove the next comment character if you are not familiar with SQL
156+
#safe-updates
157+
158+
[myisamchk]
159+
key_buffer_size = 256M
160+
sort_buffer_size = 256M
161+
read_buffer = 2M
162+
write_buffer = 2M
163+
164+
[mysqlhotcopy]
165+
interactive-timeout

0 commit comments

Comments
 (0)