1. 程式人生 > >mysql5.5.48的my.cnf配置

mysql5.5.48的my.cnf配置

MYSQL配置
[client]
port		= 3306
socket		= /tmp/mysql.sock
[mysqld]
port		= 3306
default-storage-engine=MyISAM
max_connections=1500
socket		= /tmp/mysql.sock
skip-external-locking
skip-innodb
key_buffer_size = 4096M
bulk_insert_buffer_size = 64M
myisam_max_sort_file_size = 40G
max_allowed_packet = 32M
table_open_cache = 3600
open_files_limit=65535
tmp_table_size=256M
sort_buffer_size = 4M
read_buffer_size = 16M
query_cache_min_res_unit = 2k
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 128M
thread_cache_size = 256
query_cache_type=1
query_cache_size= 128M
innodb_buffer_pool_size = 1024M
skip-name-resolve
wait_timeout=200
thread_concurrency = 8
innodb_buffer_pool_instances = 35
innodb_file_per_table = 1
datadir = /data/mydata
log-bin=/data/binlogs/mysql-bin
binlog-do-db=TD_OA
expire_logs_day=30
max_binlog_size = 200M
slow_query_log=ON
slow-query-log-file=/data/binlogs/slow_query.log
long_query_time=2
log_bin_trust_function_creators=1
binlog_format=mixed
server-id	= 1
[mysqldump]
quick
max_allowed_packet = 64M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 1024M
sort_buffer_size = 512M
read_buffer = 256M
write_buffer = 256M
[mysqlhotcopy]
interactive-timeout
# 預設引擎
default-storage-engine=MyISAM
# 最大連線數
max_connections=1500

資料儲存目錄

datadir = /data/mydata

# 二進位制日誌
log-bin=/data/binlogs/mysql-bin
# 只記錄TD_OA的日誌
binlog-do-db=TD_OA
# 保留30天日誌
expire_logs_day=30
# 日誌單個檔案最大200M
max_binlog_size = 200M
# 開啟慢日誌
slow_query_log=ON
slow-query-log-file=/data/binlogs/slow_query.log
# 慢日誌為超過兩秒的記錄
long_query_time=2
log_bin_trust_function_creators=1

binlog_format=mixed

修復表命令:

# mysqlcheck -r TD_OA SYS_LOG -uroot -p