linux之家
linux之家-让学习更轻松

你的位置:首页>>Linux数据库知识>>Linux系统高负载 MySQL数据库彻底优化(3)

Linux系统高负载 MySQL数据库彻底优化(3)

发表时间:2007-9-23 上午 01:00:11浏览次数:

  QUOTE:

  # Example MySQL config file for medium systems.
  #
  # This is for a system with little memory (32M - 64M) where MySQL plays
  # an important part, or systems up to 128M where MySQL is used together with
  # other programs (such as a web server)
  #
  # You can copy this file to
  # /etc/my.cnf to set global options,
  # mysql-data-dir/my.cnf to set server-specific options (in this
  # installation this directory is /var/lib/mysql) or
  # ~/.my.cnf to set user-specific options.
  #
  # In this file, you can use all long options that a program supports.
  # If you want to know which options a program supports, run the program
  # with the "--help" option.

  # The following options will be passed to all MySQL clients
  [client]
  #password = your_password
  port = 3306
  socket = /tmp/mysql.sock
  #socket = /var/lib/mysql/mysql.sock
  # Here follows entries for some specific programs

  # The MySQL server
  [mysqld]
  port = 3306
  socket = /tmp/mysql.sock
  #socket = /var/lib/mysql/mysql.sock
  skip-locking
  key_buffer = 128M
  max_allowed_packet = 1M
  table_cache = 256
  sort_buffer_size = 1M
  net_buffer_length = 16K
  myisam_sort_buffer_size = 1M
  max_connections=120
  #addnew config
  wait_timeout =120
  back_log=100
  read_buffer_size = 1M
  thread_cache=32
  skip-innodb
  skip-bdb
  skip-name-resolve
  join_buffer_size=512k
  query_cache_size = 32M
  interactive_timeout=120
  long_query_time=10
  log_slow_queries= /usr/local/mysql4/logs/slow_query.log
  query_cache_type= 1
  # Try number of CPU''s*2 for thread_concurrency
  thread_concurrency = 4

  #end new config
  # Don''t listen on a TCP/IP port at all. This can be a security enhancement,
  # if all processes that need to connect to mysqld run on the same host.
  # All interaction with mysqld must be made via Unix sockets or named pipes.
  # Note that using this option without enabling named pipes on Windows
  # (via the "enable-named-pipe" option) will render mysqld useless!
  #
  #skip-networking

  # Replication Master Server (default)
  # binary logging is required for replication
  #log-bin

  # required unique id between 1 and 2^32 - 1
  # defaults to 1 if master-host is not set
  # but will not function as a master if omitted
  server-id = 1

  # Replication Slave (comment out master section to use this)
  #
  # To configure this host as a replication slave, you can choose between
  # two methods :
  #
  # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  # the syntax is:
  #
  # CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,
  # MASTER_USER=, MASTER_PASSWORD= ;
  #
  # where you replace , , by quoted strings and
  # by the master''s port number (3306 by default).
  #
  # Example:
  #
  # CHANGE MASTER TO MASTER_HOST=''125.564.12.1'', MASTER_PORT=3306,
  # MASTER_USER=''joe'', MASTER_PASSWORD=''secret'';
  #
  # OR

读者体会
暂无回复
姓名:
评论内容:
     
热点导读
Linux系统高负载 My
Linux系统高负载 My
Linux系统高负载 My
RHCE实战考试经验
RHCE--实力的最终测试
如何备考RHCE
RHCE应考指南
Linux相关的四个认证
国家Linux技术水平认证
CSIP对其在国家Linu
使用Linux做Radiu
Linux认证基本知识介绍
Oracle数据库开发(二
红帽Linux获美国政府最
Linux操作系统安全配置
如何用Linux Live
物理隔离 Linux如何贯
用SRP建立安全的Linu
Linux安全攻略 了解系
Linux安全攻略 服务器
微软要用数据证明Vista
用LVS在Linux上搭建
Linux操作系统安装VM
下载工具介绍 aMule在
Linux操作系统中安装E
Linux操作系统下网络互
Linux应用问答系列之硬
Linux系统下设置用户登
Apache2.0.48
在Linux系统下面架设S
Copyright 2006-2007 linux77.com Inc. All Rights Reserved
Emai:skyzznj@126.com