转载 mysql 数据库优化配置实例

网友投稿 675 2022-05-28

Mysql服务器my.cnf配置文档详解

硬件:内存16G

[client]

port = 3306

socket = /data/3306/mysql.sock

[mysql]

no-auto-rehash

[mysqld]

user = mysql

port = 3306

socket = /data/3306/mysql.sock

basedir = /usr/local/mysql

datadir = /data/3306/data

open_files_limit = 10240

back_log = 600

max_connections = 3000

max_connect_errors = 6000

table_cache = 614

external-locking = FALSE

max_allowed_packet = 32M

sort_buffer_size = 2M

join_buffer_size = 2M

thread_cache_size = 300

thread_concurrency = 8

query_cache_size = 64M

转载 mysql 数据库优化配置实例

query_cache_limit = 4M

query_cache_min_res_unit = 2k

default-storage-engine = MyISAM

thread_stack = 192K

transaction_isolation = READ-COMMITTED

tmp_table_size = 256M

max_heap_table_size = 256M

long_query_time = 2

log_long_format

log-slow-queries=/data/3306/slow-log.log

log-bin

binlog_cache_size = 4M

max_binlog_cache_size = 8M

max_binlog_size = 512M

expire_logs_days = 7

key_buffer_size = 2048M

read_buffer_size = 1M

read_rnd_buffer_size = 16M

bulk_insert_buffer_size = 64M

myisam_sort_buffer_size = 128M

myisam_max_sort_file_size = 10G

myisam_max_extra_sort_file_size = 10G

myisam_repair_threads = 1

myisam_recover

skip-name-resolve

lower_case_table_names = 1

server-id = 1

innodb_additional_mem_pool_size = 16M

innodb_buffer_pool_size = 2048M

innodb_data_file_path = ibdata1:1024M:autoextend

innodb_file_io_threads = 4

innodb_thread_concurrency = 8

innodb_flush_log_at_trx_commit = 2

innodb_log_buffer_size = 16M

innodb_log_file_size = 128M

innodb_log_files_in_group = 3

innodb_max_dirty_pages_pct = 90

innodb_lock_wait_timeout = 120

innodb_file_per_table = 0

[mysqldump]

quick

max_allowed_packet = 32M

[mysqld_safe]

log-error=/data/3306/mysql_oldboy.err

pid-file=/data/3306/mysqld.pid

将没有使用索引的查询也记录下来

MySQL 数据库

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:从0开始学管理系列(二) —— 我们如何去管理?我们管理会碰到哪些问题?如何解决?
下一篇:关于 MongDB 数据库 33道面试题丨【绽放吧!数据库】
相关文章