标签:mysql my.cnf 参数文件 配置文件 启动参数
在linux下面的/etc/my.cnf的参数详解汇总
MYSQL–my.cnf配置中文详解
basedir = path 使用给定目录作为根目录(安装目录)。open-files-limit = 8192
以上很多参数大家不一定用上,但是遇到了大家能知道什么意思
以下是一个测试环境的例子:
/etc/my.cnf
[mysqld]
#datadir=/var/lib/mysql
datadir=/home/data/mysql
#socket=/var/lib/mysql/mysql.sock
socket=/home/data/mysql/mysql.sock
user=mysql
port=3306
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set=utf8
init_connect = ‘SET NAMES utf8‘
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
expire_logs_day=3
slow_query_log=1
#slow_query_log_file=/home/data/mysql/slow.log
server-id=1
log-bin=mysqlbin
innodb_flush_log_at_trx_commit=1
sync_binlog=1
init_connect=‘SET NAMES utf8‘
log-bin=mysqlbin
master-host=192.168.1.106
master-user=db
master-pass=111111
master-connect-retry=60
replicate-do-db=dcs
master-port=3306
slave-net-timeout=60
#replicate-do-db=db
back_log = 512
key_buffer_size = 8M
max_allowed_packet = 4M
sort_buffer_size = 6M
read_buffer_size = 4M
join_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 64
query_cache_size = 0M
tmp_table_size = 96M
max_connections = 500
table_cache= 1024
innodb_additional_mem_pool_size= 16M
innodb_log_buffer_size= 64M
read_rnd_buffer_size= 16M
innodb_buffer_pool_size= 1G
innodb_log_file_size = 256M
max_heap_table_size = 96M
innodb_data_file_path = ibdata1:200M:autoextend
default-storage-engine=innodb
max_connect_errors = 100000
long_query_time = 1
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
#default-character-set=utf8
标签:mysql my.cnf 参数文件 配置文件 启动参数
原文地址:http://blog.csdn.net/lihaiwenshu/article/details/40434093