您的位置:首页 > 数据库 > MySQL

二、mysql配置文件模板

2014-12-01 16:46 288 查看
引用《高性能MySQL》第8章
my.cnf内容:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
# basedir = .....
# server_id = .....
datadir = /var/lib/mysql
port = 3306
socket = /var/lib/mysql/mysql.sock
pid_file = /var/lib/mysql/mysql.pid
user = mysql
default_storage_engine = InnoDB

# InnoDB
innodb_buffer_pool_size = <value>
innodb_log_file_size = <value>
innodb_file_per_table = 1
innodb_flush_nethod = 0_DIRECT

# MyISAM
key_buffer_size = <value>
# log
# log_bin
log_error = /var/lib/mysql/mysql-error.log
slow_query_log = /var/lib/mysql/mysql-slow.log
# other
tmp_table_size = 32M
max_heap_table_size = 32M
query_cache_type = 0
query_cache_size = 0
max_connections = <value>
thread_cache = <value>
table_cache = <value>
open_files_limit = 65535

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

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

explicit_defaults_for_timestamp
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  MySQL 配置文件 my.cnf