Basic MySQL Configuration

Source: Internet
Author: User

The query_cache_size and tmp_table_size options must be set!
 
# The following options will be passed to all MySQL clients
[Client]
# Password = your_password
Port = 3306
Socket =/home/work/mysql/tmp/mysql. sock
 
# Here follows entries for some specific programs
 
# The MySQL server
[Mysqld]
Port = 3306
Bind-address = 127.0.0.1
Socket =/home/work/mysql/tmp/mysql. sock
# Skip-locking
Max_allowed_packet = 1 M
Table_open_cache = 16
Sort_buffer_size = 8 M
Read_buffer_size = 512 K
Read_rnd_buffer_size = 256 K
Net_buffer_length = 8 K
Thread_stack = 128 K
 
# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# Is also required by the OS to cache rows. Even if you're not using
# MyISAM tables, you should still set it to 8-64 M as it will also be
# Used for internal temporary disk tables.
Key_buffer_size = 8 M
 
# If the temporary file used for fast index creation wocould be bigger
# Than using the key cache by the amount specified here, then prefer
# Key cache method. This is mainly used to force long character keys in
# Large tables to use the slower key cache method to create the index.
Myisam_sort_buffer_size = 8 M
 
# Query cache is used to cache SELECT results and later return them
# Without actual executing the same query once again. Having the query
# Cache enabled may result in significant speed improvements, if your
# Have a lot of identical queries and rarely changing tables. See
# "Qcache_lowmem_prunes" status variable to check if the current value
# Is high enough for your load.
# Note: In case your tables change very often or if your queries are
# Textually different every time, the query cache may result in
# Slowdown instead of a performance improvement.
Query_cache_size = 16 M
 
# Maximum size for internal (in-memory) temporary tables. If a table
# Grows larger than this value, it is automatically converted to disk
# Based table This limitation is for a single table. There can be deleted
# Of them.
Tmp_table_size = 16 M
 
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# If all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (Using the "enable-named-pipe" option) will render mysqld useless!
#
Skip-networking
Server-id = 1
 
# Uncomment the following if you want to log updates
# Log-bin = mysql-bin
 
# Binary logging format-mixed recommended
# Binlog_format = mixed
 
# Uncomment the following if you are using InnoDB tables
# Default_storage_engine = InnoDB
 
Innodb_data_home_dir =/home/work/mysql/var/
Innodb_data_file_path = ibdata1: 10 M: autoextend
Innodb_log_group_home_dir =/home/work/mysql/var/
# You can set .. _ buffer_pool_size up to 50-80%
# Of RAM but beware of setting memory usage too high
Innodb_buffer_pool_size = 32 M
Innodb_additional_mem_pool_size = 4 M
# Set .. _ log_file_size to 25% of buffer pool size
Innodb_log_file_size = 10 M
Innodb_log_buffer_size = 16 M
Innodb_flush_log_at_trx_commit = 1
Innodb_lock_wait_timeout = 50
 
[Mysqldump]
Quick
Max_allowed_packet = 16 M
 
[Mysql]
No-auto-rehash
# Remove the next comment character if you are not familiar with SQL
# Safe-updates
 
[Myisamchk]
Key_buffer_size = 8 M
Sort_buffer_size = 8 M
 
[Mysqlhotcopy]
Interactive-timeout

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.