概述不同版本的配置文件参数及使用方法略略有不同,具体可参考官网版主文档 。如果选项名称配置错误,MySQL有可能不能启动 。MySQL的配置文件一般为my.cny,不同版本或不同操作系统可能存放位置不一样 。以下是MySQL配置文件常用选项(mysqld选项段) 。
常用配置项说明
- bind-address
- port
- socket
- datadir
- tmpdir
- skip-external-locking
- back-log
- character-set-server
- key_buffer_size
- max_connections
- max_connect_errors
- table_cache
- max_allowed_packet
- binlog_cache_size
- sort_buffer_size
- join_buffer_size
- thread_cache_size
- thread_concurrency
- query_cache_size
- query_cache_limit
- ft_min_word_len
- thread_stack
- transaction_isolation
- tmp_table_size
- net_buffer_length
- read_buffer_size
- read_rnd_buffer_size
- max_heap_table_size
- default-storage-engine
- log-bin
- server-id
- slow_query_log
- long_query_time
- log-queries-not-using-indexes
- expire-logs-days
- replicate_wild_ignore_table
- replicate_wild_do_table
- innodb_data_home_dir
- innodb_file_per_table
- innodb_data_file_path
- innodb_log_group_home_dir
- innodb_additional_mem_pool_size
- innodb_buffer_pool_size
- innodb_file_io_threads
- innodb_thread_concurrency
- innodb_flush_log_at_trx_commit
- innodb_log_buffer_size
- innodb_log_file_size
- innodb_log_files_in_group
- innodb_max_dirty_pages_pct
- innodb_lock_wait_timeout