日期:2014-05-16  浏览次数:20431 次

oachina.net 数据库配置

# Example MySQL config file for large systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/var) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
port??????????? = 3306
socket????????? = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server

[mysqld]
datadir=/data/mysql
event_scheduler=ON
#pid-file=/data/mysql/mysqld.pid
default-character-set=utf8
port??????????? = 3306
socket????????? = /tmp/mysql.sock
external-locking = FALSE
back_log = 1024
max_connections = 2000
max_connect_errors = 1024
open_files_limit = 4096
skip-locking
key_buffer = 512M
max_allowed_packet = 24M
table_cache = 1024K
sort_buffer_size = 16M
read_buffer_size = 16M
join_buffer_size = 16M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 128M
thread_cache_size = 16
thread_concurrency = 8
thread_stack = 512k
query_cache_limit = 2M
query_cache_size= 512M
query_cache_min_res_unit= 2
# Try number of CPU's*2 for thread_concurrency
tmp_table_size = 256M
bulk_insert_buffer_size = 4M
skip-name-resolve

slow_query_log
long_query_time = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
default-character-set=utf8

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout