欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

mysql5.6安装sys库_MySQL5.6数据库优化my.cnf配置

发布时间:2024/9/18 42 豆豆
生活随笔 收集整理的这篇文章主要介绍了 mysql5.6安装sys库_MySQL5.6数据库优化my.cnf配置 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

系统环境:

4核    8G    CentOS7.0    MySQL5.6

配置内容:[client]

port=3306

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

default-character-set=utf8

[mysqld]

bind-address=0.0.0.0

port=3306

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

datadir=/var/lib/mysql

character-set-server=utf8

##############################################################################

#innodb

default_storage_engine=InnoDB

user=mysql

innodb_buffer_pool_size=6G

innodb_log_file_size=4G

innodb_log_buffer_size=8M

innodb_flush_log_at_trx_commit=2

innodb_file_per_table=1

innodb_file_io_threads=4

innodb_flush_method=O_DIRECT

innodb_io_capacity=2000

innodb_io_capacity_max=6000

innodb_lru_scan_depth=2000

innodb_thread_concurrency = 0

innodb_additional_mem_pool_size=16M

innodb_autoinc_lock_mode = 2

##############################################################################

# Binary log/replication

#log-bin

sync_binlog=1

sync_relay_log=1

relay-log-info-repository=TABLE

master-info-repository=TABLE

expire_logs_days=7

binlog_format=ROW

transaction-isolation=READ-COMMITTED

##############################################################################

#cache

tmp_table_size=512M

character-set-server=utf8

collation-server=utf8_general_ci

skip-external-locking

back_log=1024

key_buffer_size=1024M

thread_stack=256k

read_buffer_size=8M

thread_cache_size=64

query_cache_size=128M

max_heap_table_size=256M

query_cache_type=1

binlog_cache_size = 2M

table_open_cache=128

thread_cache=1024

thread_concurrency=8

wait_timeout=30

join_buffer_size = 1024M

sort_buffer_size = 8M

read_rnd_buffer_size = 8M

##############################################################################

#connect

max-connect-errors=100000

max-connections=1000

##############################################################################

explicit_defaults_for_timestamp=true

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

##############################################################################

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

总结

以上是生活随笔为你收集整理的mysql5.6安装sys库_MySQL5.6数据库优化my.cnf配置的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。