MySQL 配置文件:
my.ini
my.cnf
(位于 /etc/my.cnf
)[client]port = 3306socket = /usr/local/services/mysql/var/data/mysql.sock[mysqld]bind-address = 0.0.0.0port = 3306socket = /usr/local/services/mysql/var/data/mysql.sockpid-file = /usr/local/services/mysql/var/logs/mysql.pidcharacter-set-server = utf8basedir = /usr/local/services/mysqldatadir = /usr/local/services/mysql/var/dataskip-external-locking# 禁用主机名解析skip-name-resolvelower_case_table_names = 1log-bin-trust-function-creators = 1max_connections = 6000max_user_connections = 6000max_connect_errors = 4000wait_timeout = 86400interactive_timeout = 86400table_open_cache = 512max_allowed_packet = 32Msort_buffer_size = 2Mjoin_buffer_size = 2Mthread_cache_size = 8thread_concurrency = 8query_cache_size = 32M# 默认的数据库引擎#default-storage-engine = InnoDB#sql_mode="STRICT_ALL_TABLES,NO_AUTO_CREATE_USER"server-id = 1log-short-formatlog-error = /usr/local/services/mysql/var/logs/mysql.logslow_query_loglong_query_time = 2slow_query_log_file = /usr/local/services/mysql/var/logs/mysql-slow.loglog-bin = /usr/local/services/mysql/var/binlog/mysql-binlog_bin_trust_function_creators=1binlog_format = MIXEDexpire_logs_days = 10# INNODB Specific optionsinnodb_data_home_dir = /usr/local/services/mysql/var/datainnodb_log_group_home_dir = /usr/local/services/mysql/var/redologinnodb_additional_mem_pool_size = 10M# 数据缓冲区innodb_buffer_pool_size = 4Ginnodb_data_file_path = ibdata1:100M:autoextendinnodb_file_io_threads = 4innodb_thread_concurrency = 8innodb_flush_log_at_trx_commit = 0innodb_flush_method = O_DIRECT# 事务在内存中的缓冲innodb_log_buffer_size = 128M# 事务日志大小innodb_log_file_size = 256Minnodb_log_files_in_group = 3innodb_max_dirty_pages_pct = 90innodb_lock_wait_timeout = 50innodb_file_per_table = 1# MyISAM Specific optionskey_buffer_size = 384Mread_buffer_size = 4Mread_rnd_buffer_size = 8Mmyisam_sort_buffer_size = 128Mmyisam_max_sort_file_size = 1Gmyisam_repair_threads = 1myisam_recover[mysqldump]quickmax_allowed_packet = 16M[mysql]default-character-set = utf8no-auto-rehashsocket = /usr/local/services/mysql/var/data/mysql.sock[myisamchk]key_buffer_size = 256Msort_buffer_size = 256Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeout