MY.CNF sample File

Source: Internet
Author: User

As shown below:

[Mysqld_safe]
Pid-file=/project/class2/mysql/run/mysqld.pid
#malloc-lib=/project/class2/mysql/lib/libjemalloc.so

[MySQL]
port=3306
Prompt=\\[email protected]\\d \\r:\\m:\\s>
Default-character-set=gbk
No-auto-rehash

[Client]
port=3306
Socket=/project/class2/mysql/run/mysql.sock

[Mysqld]
#dir
Basedir=/project/class2/mysql
Datadir=/project/class2/mysql/data
Tmpdir=/tmp
Lc_messages_dir=/project/class2/mysql/share
Log-error=/project/class2/mysql/log/alert.log
Slow_query_log_file=/project/class2/mysql/log/slow.log
General_log_file=/project/class2/mysql/log/general.log
Socket=/project/class2/mysql/run/mysql.sock

#innodb
Innodb_data_home_dir=/project/class2/mysql/data
Innodb_log_group_home_dir=/project/class2/mysql/data
Innodb_data_file_path=ibdata1:2g;ibdata2:16m:autoextend
innodb_buffer_pool_size=10g
Innodb_buffer_pool_instances=4
innodb_log_files_in_group=2
innodb_log_file_size=1g
innodb_log_buffer_size=200m
Innodb_flush_log_at_trx_commit=1
innodb_additional_mem_pool_size=20m
Innodb_max_dirty_pages_pct=60
innodb_io_capacity=1000
Innodb_thread_concurrency=16
Innodb_read_io_threads=8
Innodb_write_io_threads=8
innodb_open_files=60000
Innodb_file_format=barracuda
Innodb_file_per_table=1
Innodb_flush_method=o_direct
Innodb_change_buffering=inserts
Innodb_adaptive_flushing=1
innodb_old_blocks_time=1000
Innodb_stats_on_metadata=0
Innodb_read_ahead=0
Innodb_use_native_aio=0
Innodb_lock_wait_timeout=5
Innodb_rollback_on_timeout=0
Innodb_purge_threads=1
Innodb_strict_mode=1
transaction-isolation=read-committed

#myisam
key_buffer=64m
myisam_sort_buffer_size=64m
concurrent_insert=2
delayed_insert_timeout=300

#replication
Master-info-file=/project/class2/mysql/log/master.info
Relay-log=/project/class2/mysql/log/relaylog
Relay_log_info_file=/project/class2/mysql/log/relay-log.info
Relay-log-index=/project/class2/mysql/log/mysqld-relay-bin.index
Slave_load_tmpdir=/project/class2/mysql/tmp
Slave_type_conversions= "All_non_lossy"
Slave_net_timeout=4
Skip-slave-start
sync_master_info=1000
sync_relay_log_info=1000

#binlog
Log-bin=/project/class2/mysql/log/mysql-bin
server_id=2552763370
binlog_cache_size=32k
max_binlog_cache_size=2g
max_binlog_size=500m
Binlog-format=row
sync_binlog=1000
Log-slave-updates=1
Expire_logs_days=0

#server
Default-storage-engine=innodb
Character-set-server=gbk
Lower_case_table_names=1
Skip-external-locking
open_files_limit=65536
Safe-user-create
Local-infile=1
#sqlmod = "Strict_all_tables,no_zero_in_date,no_zero_date"
Performance_schema=0

Log_slow_admin_statements=1
Log_warnings=1
Long_query_time=1
Slow_query_log=1
General_log=0

Query_cache_type=0
query_cache_limit=1m
query_cache_min_res_unit=1k

table_definition_cache=65536
table_cache=65536

thread_stack=512k
thread_cache_size=256
read_rnd_buffer_size=128k
sort_buffer_size=256k
join_buffer_size=128k
read_buffer_size=128k

port=3306
Skip-name-resolve
Skip-ssl
max_connections=4500
max_user_connections=4000
max_connect_errors=65536
max_allowed_packet=128m
Connect_timeout=8
Net_read_timeout=30
Net_write_timeout=60
back_log=1024

#server ID

MY.CNF sample File

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.