/etc/my.cnf 參考配置: [mysqld] #skip-grant-tables #default-character-set=utf8 #character-set-server=utf8 port= 3306 skip-external-locking key_buffer_size ...
/etc/my.cnf 參考配置: [mysqld] #skip-grant-tables #default-character-set=utf8 #character-set-server=utf8 port= 3306 skip-external-locking key_buffer_size = 16K basedir=/usr/local/var/mysql datadir=/usr/local/var/mysql/data log-error=/usr/local/var/mysql/log/error.log pid-file=/usr/local/var/mysql/localhost.localdomain.pid socket=/usr/local/var/mysql/mysql.sock #binlog_format = mixed binlog_format = statement log-bin = /var/lib/mysql/mybinlog server-id = 2 #慢查詢日誌: slow_query_log=off|on #是否開啟慢查詢日誌 slow_query_log_file=filename #指定保存路徑及文件名,預設為數據文件目錄,hostname-slow.log long_query_time=2 #指定多少秒返回查詢的結果為慢查詢 long-queries-not-using-indexes #記錄所有沒有使用到索引的查詢語句 min_examined_row_limit=1000 #記錄那些由於查找了多餘1000次而引發的慢查詢 long-slow-admin-statements #記錄那些慢的optimize table,analyze table和alter table語句 log-slow-Slave-statements #記錄由Slave所產生的慢查詢 #binlog複製配置: binlog_format = MIXED #binlog日誌格式,mysql預設採用statement,建議使用mixed log-bin = /data/mysql/mysql-bin.log #binlog日誌文件 expire_logs_days = 7 #binlog過期清理時間 max_binlog_size = 100m #binlog每個日誌文件大小 binlog_cache_size = 4m #binlog緩存大小 max_binlog_cache_size = 512m #最大binlog緩存大小