MySQL performance optimization tips
Author: ye Jinrong (email :), source: http://imysql.cn, reproduced please indicate the translator and the source, and cannot be used for commercial purposes, offenders must investigate.
I. startup Parameter Optimization
Modify my. CNF (or my. INI) and add/modify the following lines:
# Set the number of cached connections to save connection overhead
Back_log = 64
# Disable the file system external lock
External-locking = 0
# Disable bdb. If you do not need it, so does InnoDB.
Skip-bdb
# Index buffer. If it is a dedicated database server, you can set up to half of the server's memory. If it is not dedicated,
# Set it a little lower
Key_buffer = 512 m
# Number of cached data tables. If the memory size is large, you can set a slightly higher value. Otherwise, you can set a lower value.
# To set this parameter, see open_tables in the system status (indicating the total number of opened data tables)
# And opened_tables (indicating the total number of open data tables)
Table_cache = 128
# Disable DNS resolution. If you use DNS authorization in your authorization information, this option cannot be enabled.
Skip-name-resolve
# Records slow queries and queries without indexes, which helps you analyze the problem
Long_query_time = 1
Log-Slow-queries =/usr/local/MySQL/data/slow. Log
Log-queries-not-using-Indexes
Other parameters suchsort_buffer_size,net_buffer_length,read_buffer_size,read_rnd_buffer_size,myisam_sort_buffer_size,
thread_cache_size,query_cache_size,max_binlog_cache_size
Please query the MySQL manual and make appropriate adjustments.
Ii. Other small tips