○ my.cnf

・MySQL-5.1.58で使っています
・/usr/local/share/mysql/my-medium.cnfを改名したものです
・完全コピーしないこと (エラーが出ることあり)

・"character-set-server = utf8"でサーバの文字セットを設定します
・"collation-server =utf8_unicode_ci"でサーバの照合順序を設定します
・"datadir = /home/mysql/"でデータの保存先を変更しています
・"skip-federated"オプションは機能しません
・"skip-innodb"オプションは、"innodb"が組み込まれている場合に機能します

・#の後に半角空きがあるもの 設定の説明
・#の後に半角空きがないもの 設定の無効
紫色文字 追加変更した部分です

○/etc/my.cnf

 
 
 
 
 

001 
002
003
004

005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022

023
024
025
026
027
028
029
030
031

032
033
034
035
036
037

038
039
040
041
042
043

044
045
046
047
048
049
050
051
052
053

054
055
056
057
058
059
060
061
062
063

064
065
066
067

068
069
070
071
072

073
074
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together
# with other programs (such as a web server)

[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]
character-set-server = utf8
collation-server = utf8_unicode_ci
skip-character-set-client-handshake
datadir = /home/mysql/
plugin_dir = /usr/local/lib/mysql/plugin/
port = 3306
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysqld.pid
general_log = 1
general_log_file = /var/lib/mysql/mysqld.log
slow_query_log = 1
slow_query_log_file = /var/lib/mysql/mysqld-slow.log
log-error = /var/lib/mysql/mysqld
query_cache_limit = 1M
query_cache_min_res_unit = 4k
query_cache_size = 24M
query_cache_type = 1

skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

#skip-networking
log-bin=/var/lib/mysql/mysql-bin
expire_logs_days=35
#max-binlog-size=100M
binlog_format=mixed
server-id = 1

#server-id = 2
#master-host = <hostname>
#master-user = <username>
#master-password = <password>
#master-port = <port>
#log-bin=mysql-bin

skip-innodb
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
skip-opt
quick
max_allowed_packet = 16M
default-character-set = binary
create-options
set-charset
hex-blob
#single-transaction
master-data

[mysql]
default-character-set = utf8
no-auto-rehash
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

○ Copyright(c) 528p.com All Rights Reserved.