MySQL configuration file

Source: Internet
Author: User

[Mysqld]

the path where the Datadir=/var/lib/mysql database resides

Socket=/var/lib/mysql/mysql.sock Socket Path

Old_passwords=1 compatible with hash password before version 4.1

Max_connections = max number of connections

max_connect_errors=500000000 Maximum number of wrong connections, preventing bad connection waiting and causing performance degradation

max_allowed_packet=61457280 Send the maximum packet value

max_length_for_sort_data=8096 sets a value that triggers the use of two-way sorting, which is less than the Ord by sort using single-way sorting

delayed_insert_timeout=300 Setting the time-out for deferred insertion, or terminating the insertion if it is not inserted within the specified time

table_cache=356 Limit The maximum number of cache tables, show global status like ' Open%_tables ';

sort_buffer_size=50m Sort Cache Size setting, when high concurrency is not recommended too large

Key_buffer_size=264m the RMA value of the indexed chunk for better processing index

read_buffer_size=50m the buffer size of a random read query, that is, the buffer size at query time

join_buffer_size=50m Maximum cache block length when a join operation is in progress

tmp_table_size=100m the size of a temporary table

max_heap_table_size=100m The maximum size of the memory table, the memory table stores the table structure on disk and puts the data in memory. As a result, the data content in the memory is not there after restarting the database, but the table structure is still there. The engine of the temp table and the memory table is different, the MyISAM of the temporary table, and the memory table is the memories. The efficiency of the memory table is higher than the temp table

myisam_sort_buffer_size=50m The maximum size of temporary files is allowed when rebuilding indexes

query_cache_size=64m Set the size of the query buffer, show variables like ' Have_query_cache '; show variables like ' query_cache_size ';


Query_cache_type = 1
The query results are written to the cache. Here you can set three values of 0, with 0 indicating that the cache is closed, that is, the query structure is not written to the cache, 1 is written, and 2 is demand. But it turns out that, as long as it doesn't close, the query goes to the cache first.


Skip-name-resolve Disabling domain name Resolution

Ft_min_word_len = 1 Turn on full-text search, pre-index full-site content

Character-set-server=utf8 Setting the character encoding service used

Log-bin=mysql-binf Set the start name of the binary log

expire-logs-days=3 Setting the log Expiration Time

Binlog_format = Statement Sets the Binlog_format mode, statement indicates that each SQL modification is logged. If set to =row, it means that the modified row is recorded, and it can also be set to Mixedlevel, mixed mode for both, the master-slave copy is used when the master-slave copy is performed, and the statement replication occurs when the data is modified normally.

Server-id=1





#query

Long_query_time=30 the time to determine the slow query

Slow_query_log_file=/var/log/mysql_slow.log setting The log file for slow queries

Slow-query-log=on turn on slow query

Slow_query_log_timestamp_precision = microsecond timestamp for a statement that is determined to be a slow query

Log-slow-queries =/var/log/mysql_slow.log the location after which the slow query statement is determined

Default-storage-engine = MyISAM default storage engine settings

Log_error =/var/log/mysqld.log where the error log is stored

Slave_load_tmpdir =/data/mysql_tmp_no_del boot temporary files from the server

Tmpdir =/backup/mysql_tmp_no_del temp file directory


[Mysqld_safe]

Pid-file=/var/lib/mysql/mysqld.pid Specify the file that holds the PID

This article is from the "12208412" blog, please be sure to keep this source http://12218412.blog.51cto.com/12208412/1888940

MySQL configuration 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.