MySQL数据库优化经验详谈(3)

来源:asp之家 时间:2009-12-15 10:34:00 


代码:


# 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

标签:MySQL优化,MySQL技巧
0
投稿

猜你喜欢

  • ASP程序开发注意的安全事项

    2010-05-03 10:55:00
  • Asp+ajax打造无刷新新闻评论系统

    2008-02-12 15:43:00
  • VML模拟Rose画流程图代码

    2008-09-02 10:58:00
  • Insert into与AddNew哪一个更好?

    2009-10-28 18:30:00
  • mysql3升级到mysql5解决乱码心得

    2009-04-20 14:41:00
  • WAP页面设计与实现小贴士

    2011-01-10 20:38:00
  • asp让网站自动识别手机访问跳转至手机网站

    2014-12-06 09:36:02
  • javascript中类的创建和继承

    2008-05-08 12:07:00
  • 教你怎么使用sql游标实例分享

    2012-07-11 16:14:57
  • Asp 操作Access数据库时出现死锁.ldb的解决方法

    2011-03-29 10:49:00
  • 用Asp修改注册表

    2008-01-04 12:33:00
  • ASP状态封装类Cache、Cookie & Session

    2008-05-11 19:33:00
  • css网页下拉菜单制作方法(3):样式修饰

    2007-02-03 11:39:00
  • 一个asp正则替换的方法

    2008-11-25 14:05:00
  • RS.GETROWS使用详解

    2008-01-16 13:21:00
  • 解析SQL Server 2008中的新语句:MERGE

    2009-01-13 13:57:00
  • CSS的书写顺序规范

    2008-06-12 13:51:00
  • 对xml操作的主要方法例子

    2008-06-29 14:21:00
  • 最简洁的多重查询的解决方案

    2008-03-02 15:51:00
  • mysql基础教程:安装与操作

    2009-07-30 08:18:00
  • asp之家 网络编程 m.aspxhome.com