Mysql配置文件配置

[mysqld]
server-id                      = 1
port                           = 3306
basedir                        = /iddbs/mysql57
datadir                        = /data
socket                         = /data/mysql.sock
pid-file                       = /data/mysql.pid
log-bin                        = /data/mysql-bin
relay-log                      = /data/relay-bin
log-error                      = /data/mysql-error.log
interactive_timeout            = 172800
wait_timeout                   = 172800
max_allowed_packet             =16M
expire_logs_days               =7
auto-increment-increment       =2 
auto-increment-offset          =1 
character-set-server           = utf8
collation_server               = utf8_general_ci
key-buffer-size                = 32M
myisam_repair_threads          = 1
max-allowed-packet             = 16M
max-connect-errors             = 1000000
skip-name-resolve
sysdate-is-now                 = 1
sync-binlog                    = 1
slave-net-timeout              = 60
query-cache-type               = 0
query-cache-size               = 0
back_log                       = 50
tmp_table_size                 = 64M
max_heap_table_size            = 64M
max_connections                = 1024
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 4096
table-open-cache               = 4096
read_buffer_size               = 131072
sort_buffer_size               = 1M
join_buffer_size               = 1M
thread_cache_size              = 8
thread_stack                   = 192K
innodb-flush-log-at-trx-commit = 1
innodb_data_file_path           =ibdata1:1G:autoextend
innodb-buffer-pool-size        = 15G
innodb_write_io_threads        = 8
innodb_read_io_threads         = 8
innodb_thread_concurrency      = 16
innodb_flush_log_at_trx_commit = 1
innodb_max_dirty_pages_pct     = 90
innodb_lock_wait_timeout       = 120
log_bin_trust_function_creators = 1       
lower_case_table_names         =1
default-storage-engine         = InnoDB
innodb-flush-method            = O_DIRECT
log-bin                        = mysql-bin
binlog_format                  = row
auto_increment_increment=1
auto_increment_offset=1
relay_log_recovery=1
#sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sql_mode=NO_ENGINE_SUBSTITUTION


[mysqldump]
# Do not buffer the whole result set in memory before writing it to
# file. Required for dumping very large tables
quick
max_allowed_packet = 16M


[mysql]
no-auto-rehash
# Only allow UPDATEs and DELETEs that use keys.
#safe-updates


[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M


[mysqlhotcopy]
interactive-timeout

物理内存: 128G  mysql 设定 为50%--80% 最好是50%  设的很大会影响 硬盘到内存的读取速度(存在硬盘数据刷到内存中)

无需登录mysql数据库查看Mysql版本: ./mysql --version

猜你喜欢

转载自blog.csdn.net/u013488838/article/details/73550309