MySQL configuration file Template

Source: Internet
Author: User

# The MySQL server

[Mysqld]

port=3306

User=mysqld

Socket=/data/mysqldata/3306/mysql.sock

Pid-file=/data/mysqldata/3306/mysql.pid

Basedir=/usr/local/mysql

Datadir=/data/mysqldata/3306/data

Tmpdir=/data/mysqldata/3306/tmp

open_files_limit=10240

Explicit_defaults_for_timestamp

Sql_mode=no_engine_substitution,strict_trans_tables

Federated

Server_id=1

max_connections=1000

max_connect_errors=100000

interactive_timeout=86400

wait_timeout=86400

Skip-name-resolve

Sync_binlog=0

# Buffer

Sort_buffer_size=2m

Read_buffer_size=2m

Read_rnd_buffer_size=2m

Join_buffer_size=2m

net_buffer_length=16k

max_allowed_packet=512m

bulk_insert_buffer_size=32m

max_heap_table_size=512m

tmp_table_size=512m

thread_cache_size=300

query_cache_size=128m

query_cache_limit=1m

query_cache_min_res_unit=4k

key_buffer_size=16m

myisam_sort_buffer_size=64m

myisam_max_sort_file_size=10g

Myisam_repair_threads=1

# Log

Log-bin=. /binlog/mysql-bin

binlog_cache_size=32m

max_binlog_cache_size=64m

binlog_stmt_cache_size=32m

table_open_cache=2048

max_binlog_size=512m

Binlog_format=statemaent

Log_output=file

Log-error=. /mysql-error.log

Slow_query_log=1

Slow_query_log_file=. /slow_query.log

General_log=0

General_log_file=. /general_query.log

Expire-logs-days=14

Relay-log=. /bin/relay-bin

relay-log-index=. /binlog/relay-bin.index

# InnoDB

Innodb_data_file_path=ibdata1:2048m:autoextend

innodb_log_file_size=128m

Innodb_log_files_in_group=3

innodb_buffer_pool_size=9g

Innodb_buffer_pool_instances=-1

Innodb_max_dirty_pages_pct=70

Innodb_thread_concurrency=8

Innodb_flush_method=o_direct

innodb_log_buffer_size=16m

innodb_flush_log_at_trx_commit=2


MySQL configuration file Template

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.