my.cnf設定.txt

矢野 宗一郎, 2015/06/18 16:27

ダウンロード (2.585 KB)

 
1
●バックアップの取得
2
[root@db2 ~]# cp -p /etc/my.cnf /etc/my.cnf.bak
3

    
4
●my.cnfの設定
5

    
6
以下の内容に変更する。
7

    
8
[root@db2 ~]# cat /etc/my.cnf
9
[mysqld]
10
datadir=/var/lib/mysql
11
socket=/var/lib/mysql/mysql.sock
12
user=mysql
13
# Default to using old password format for compatibility with mysql 3.x
14
# clients (those using the mysqlclient10 compatibility package).
15
old_passwords=1
16

    
17
#log=/var/log/mysql_query.log
18
port            = 3306
19
skip-locking
20
key_buffer = 256M
21
max_allowed_packet = 1M
22
table_cache = 256
23
sort_buffer_size = 1M
24
read_buffer_size = 1M
25
read_rnd_buffer_size = 4M
26
myisam_sort_buffer_size = 64M
27
thread_cache_size = 8
28
query_cache_size= 16M
29
# Try number of CPU's*2 for thread_concurrency
30
thread_concurrency = 8
31
max_connections = 512
32
default-character-set = sjis
33
#skip-character-set-client-handshake
34

    
35
# Disable Federated by default
36
skip-federated
37

    
38
# Replication Master Server (default)
39
# binary logging is required for replication
40
log-bin=mysql-bin
41

    
42
# required unique id between 1 and 2^32 - 1
43
# defaults to 1 if master-host is not set
44
# but will not function as a master if omitted
45
server-id       = 1
46

    
47
# Disabling symbolic-links is recommended to prevent assorted security risks;
48
# to do so, uncomment this line:
49
# symbolic-links=0
50
##################################################
51
#log-slow-queries=/var/log/mysql-slow.log
52
#long-query-time=2
53
#log-queries-not-using-indexes
54
#log-slow-admin-statements
55
#################################################
56
[mysqldump]
57
quick
58
max_allowed_packet = 16M
59
default-character-set = sjis
60

    
61
[mysql]
62
no-auto-rehash
63
# Remove the next comment character if you are not familiar with SQL
64
#safe-updates
65
default-character-set = sjis
66

    
67
[isamchk]
68
key_buffer = 128M
69
sort_buffer_size = 128M
70
read_buffer = 2M
71
write_buffer = 2M
72

    
73
[myisamchk]
74
key_buffer = 128M
75
sort_buffer_size = 128M
76
read_buffer = 2M
77
write_buffer = 2M
78

    
79
[mysqlhotcopy]
80
interactive-timeout
81

    
82

    
83
[mysqld_safe]
84
log-error=/var/log/mysqld.log
85
#log=/var/log/mysql_query.log
86
pid-file=/var/run/mysqld/mysqld.pid
87
port            = 3306
88
skip-locking
89
key_buffer = 256M
90
max_allowed_packet = 1M
91
table_cache = 256
92
sort_buffer_size = 1M
93
read_buffer_size = 1M
94
read_rnd_buffer_size = 4M
95
myisam_sort_buffer_size = 64M
96
thread_cache_size = 8
97
query_cache_size= 16M
98
# Try number of CPU's*2 for thread_concurrency
99
thread_concurrency = 8
100
max_connections = 512
101
default-character-set = sjis
102

    
103
●MySQL再起動
104
[root@db2 ~]# /etc/init.d/mysqld restart
105
Stopping MySQL:                                            [  OK  ]
106
Starting MySQL:                                            [  OK  ]
107