Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2268571
  • 博文数量: 293
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 2170
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-31 14:30
个人简介

自己慢慢积累。

文章分类

全部博文(293)

分类: Mysql/postgreSQL

2014-06-05 11:49:25

Percona公司提供了一个在线生成MySQL配置文件的工具,通过此工具的向导,回答一些简单问题,就可以得到一份经过Percona专家优化过的MySQL配置文件,并且格式清晰,还带有注释。强烈推荐大家去尝试一下。

地址:

下面是我生成的一份用于MySQL 5.5版本的配置文件,供参考:
# Generated by Percona Configuration Wizard () version REL5-20120208
# Configuration name slave1 generated for 350643474@qq.com at 2014-06-05 03:45:06

[mysql]

# CLIENT #
port                           = 3306
socket                         = /opt/mysqlone/mysqlone/mysql.sock

[mysqld]

# GENERAL #
user                           = mysql
default-storage-engine         = InnoDB
socket                         = /opt/mysqlone/mysqlone/mysql.sock
pid-file                       = /opt/mysqlone/mysqlone/mysql.pid

# MyISAM #
key-buffer-size                = 32M
myisam-recover                 = FORCE,BACKUP

# SAFETY #
max-allowed-packet             = 16M
max-connect-errors             = 1000000
skip-name-resolve
sql-mode                       = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY
sysdate-is-now                 = 1
innodb                         = FORCE
innodb-strict-mode             = 1

# DATA STORAGE #
datadir                        = /opt/mysqlone/mysqlone/

# BINARY LOGGING #
log-bin                        = /opt/mysqlone/mysqlone/mysql-bin
expire-logs-days               = 14
sync-binlog                    = 1

# CACHES AND LIMITS #
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
max-connections                = 500
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 1024
table-open-cache               = 2048

# INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 256M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 12G

# LOGGING #
log-error                      = /opt/mysqlone/mysqlone/mysql-error.log
log-queries-not-using-indexes  = 1
slow-query-log                 = 1
slow-query-log-file            = /opt/mysqlone/mysqlone/mysql-slow.log

阅读(2271) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~