Mysql—配置文件my.ini或my.cnf的详解

[mysqld]
log_bin = mysql-bin
binlog_format = mixed
expire_logs_days = 7  # 超过7天的binlog删除
slow_query_log
= 1 long_query_time = 3 # 慢查询时间 超过3秒则为慢查询 slow-query-log-file = /www/server/data/mysql-slow.log
log_error
= /www/server/data/mysql-error.log # 错误日志路径

ft_min_word_len = 4             # 最短的索引字符串,默认值为4,(通常改为1)修改后必须重建索引文件
ft_max_word_len =  84           # 最长的索引字符串,默认值为84,修改后必须重建索引文件

存储引擎InnoDB的配置

# 开启下条将会禁用 INNODB
# skip-innodb

default_storage_engine = InnoDB
innodb_data_home_dir = /www/server/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /www/server/data

# Innodb缓冲区大小
innodb_buffer_pool_size = 128M

# Innodb日志文件,可设置为25%-90%的总体缓存大小,默认 256M. 修改此项要先删除datadir\ib_logfileXXX
innodb_log_file_size = 64M
# Innodb日志缓冲区大小
innodb_log_buffer_size = 16M

innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 12
innodb_write_io_threads = 12
posted @ 2019-09-06 12:07  刘_love_田  阅读(...)  评论(...编辑  收藏