mysql 性能-优化服务器配置

来源:互联网 发布:hector slam算法讲解 编辑:程序博客网 时间:2024/05/10 14:07

  配置文件实例

[mysqld]

#GENERAL

datadir = /var/lib/mysql

socket = /var/lib/mysql/mysql.sock

pid_file = /var/lib/mysql/mysql.pid

user = mysql

port = 3306

default_storage_engine = InnoDB

#INNODB

innodb_buffer_pool_size = <value>

innodb_log_file_size = <value>

innodb_file_per_table = 1

innodb_flush_method = O_DIRECT

#MyISAM

key_buffer_size = <value>

#LOGGING

log_error = /var/lib/mysql/mysql-error.log

slow_query_log = /var/lib/mysql/mysql-slow.log

$OTHER

tmp_table_size = 32M

max_heap_table_size = 32M

query_cache_type = 0

query_cache_size = 0

max_connections = <value>

thread_cache = <value>

table_cache = <value>

open_files_limit = 65535

[client]

socket = /var/lib/mysql/mysql.sock

port = 3306

``````````````````````````````````````````````````````````

每隔60秒查看状态变量

mysqladmin extended-status -ri60
















0 0
原创粉丝点击