mysql configuration file Parameter Description

part 1

port = 3306: specifies Mysql open ports;

basedir = / usr / local / mysql: specify the absolute path Mysql installation;

datadir = / data / mysql_db_data: absolute path Mysql data storage;

socket = /tmp/mysql.sock: socket file

plugin_dir = usr / local / mysql / lib / plugin /: the path where the plug-in mysql plugin;

log-error = path to the error log storage /data/mysql_db/data/error.log:mysql generated, it is a text file, what is the problem encountered may want to look for clues to this file when you view the log;

symbolic-links = 0: symbolic link, if set to 1, then the data in tables and databases mysql support path stored outside the datadir under default is 0 (default mysql than the new version is 1);

part 2

local-infile = 0: set to 0 disables the function of load from the local server, is set to an opening;

max-connections = 320: set the maximum number of connections Mysql; If practical applications, a relatively large number of concurrent connections may be appropriate to increase this parameter, however, does not mean that the higher the better, because it involves the server machine performance hardware. Sometimes view the log, see for example: "Error 1040: Too many connectionssuch an error, the cause of this error is usually due to set the value of this parameter is too small lead;

query_cache_limit = 4M: Specifies a single query buffer size may be used, generally the default value is 1M;

query_cache_size = 64M: query cache size;

query_cache_type = 1: set the cache type, are the following settings:

  (1) is set to 0 to disable the cache;

  (2) set to 1, indicating that all cached results;

  (3) set to 2, represents only need to cache buffer designated by SQL_CACHE query in the select statement;

max_user_connections = 320: Set the maximum number of user connections, sometimes appears: "has more than max_user_connections active connections" error, not necessarily the number of the parameter set is not enough, sometimes need to find a cause code to see if after the connection is disconnected in time;

wait_timeout = 9000: waiting timeout time in seconds, i.e. without a connection in response to a number of seconds, the server cut off the connection with the client;

connect_timeout = 20: When the client establishes a connection with the server, the server returns an error before the handshake, the maximum wait time data packet arrives in seconds;

thread_cache_size = 256: for caching idle threads;

key_buffer_size = 16M: specifies the size of the index buffer;

part 3

join_buffer_size = 2M: If more query statement using multiple join query, the parameters may be appropriately increased, the default 2M, if very little with join query may be disregarded;

max_heap_table_size = 16M: Specifies the size of the user can create the table memory;

low_priority_updates = 1: reduction settings server writes priority set to 1 for reading based;

max_allowd_packet = 128M: setting a maximum message transmission;

max_seeks_for_key = 100: Sets the maximum number of queries allowed lookup based on key;

sort_buffer_size = 16M: by increasing the size of this value can be used to improve the query "group by" and "order by" performance;

read_buffer_size = 16M: setting server reads the buffer size;

max_connect_errors = 10: When connecting to the server when the client was not successfully blocked, and the integrated value exceeds this setting, the server prevents the client to access all subsequent;

myisam_sort_buffer_size = 64M: The maximum allowable size for temporary files created when the server is rebuilding the index;

tmp_table_size = 64M: setting temporary internal stacking table (Heap) size; of read_rnd_buffer_size = 1M: setting server random read buffer size;

open_file_limit = 6050: control the number of open files;

Part4

(1) show status command, the following meanings:  

  aborted_clients client illegal interrupt connection times
  aborted_connects connection mysql failures
  com_xxx xxx command execution times, there are a lot of strip
  connections connect mysql number of
  temporary tables Created_tmp_disk_tables created on disk
  temporary tables Created_tmp_tables created in memory
  Created_tmp_files Temporary files
  Key_read_requests The number of Requests to the Read a Key Block from at the Cache
  Key_reads at the number the of PHYSICAL reads of a Key Block from Disk
  connections Max_used_connections used simultaneously
  Open_tables open table
  Open_files open file
  Opened_tables open table
  Questions submitted to the server query number
  Sort_merge_passes If this value great, my.cnf should increase in value sort_buffer
  the number of seconds the server has been working Uptime

Recommendation (2) to improve performance:
  1. If opened_tables too, should table_cache large variations in my.cnf
  2. If Key_reads too large, should be larger in my.cnf key_buffer_size can Key_reads / Key_read_requests calculated. cache failure rate
  3. If Handler_read_rnd too large, you write SQL statements in a lot of inquiries are to scan the entire table, but did not play a key role in the index of
  4. If Threads_created too large, it is necessary to increase the my.cnf in thread_cache_size value can be calculated with the cache hit ratio Threads_created / the Connections
  5. the Created_tmp_disk_tables if too large, it is necessary to increase the value of the my.cnf tmp_table_size, based on the temporary table with the disk-based memory instead of

Guess you like

Origin www.cnblogs.com/ivy-zheng/p/10993661.html