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
投稿

猜你喜欢

  • Python字典查找数据的5个基础操作方法

    2021-09-08 23:19:45
  • Python+Selenium使用Page Object实现页面自动化测试

    2022-09-30 06:09:57
  • 永不熄灭的爱心图标——腾讯公益月捐计划 “QQ首席图标”诞生记

    2009-09-01 19:43:00
  • 理解 SQL Server 中系统表Sysobjects

    2009-01-20 15:13:00
  • 小型Drupal数据库备份以及大型站点MySQL备份策略分享

    2024-01-28 05:32:50
  • Python快速排序算法实例分析

    2021-10-23 09:14:37
  • DW实现鼠标滑过切换图片

    2008-02-03 18:49:00
  • JS将滑动门改为选项卡(需鼠标点击)的实现方法

    2024-05-22 10:36:17
  • Python教程之类型转换详解

    2021-03-23 02:48:17
  • Python异常模块traceback用法实例分析

    2022-07-22 15:47:14
  • 浅谈Go语言中的结构体struct & 接口Interface & 反射

    2024-05-22 10:30:50
  • Python之两种模式的生产者消费者模型详解

    2021-07-31 17:44:02
  • chatgpt 1020 错误码成功解决的三种方案(推荐)

    2023-02-03 17:33:28
  • Windows 8.1下MySQL5.7 忘记root 密码的解决方法

    2024-01-27 22:16:16
  • sql2005 数据同步方法

    2024-01-15 03:28:54
  • 前端图片懒加载的原理与3种实现方式举例

    2024-04-17 10:20:02
  • 浅析python中特殊文件和特殊函数

    2023-01-22 23:26:26
  • python如何实现从视频中提取每秒图片

    2023-10-15 11:36:25
  • Python实现自动计算特定格式的时间差

    2021-08-16 22:47:24
  • 远程部署工具Fabric详解(支持Python3)

    2023-10-26 14:05:18
  • asp之家 网络编程 m.aspxhome.com