Cite the 8th chapter of high-performance MySQL
MY.CNF content:
# for advice The change settings
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[Mysqld]
# Basedir = ...
# server_id = ...
DataDir =/var/lib/mysql
Port = 3306
Socket =/var/lib/mysql/mysql.sock
Pid_file =/var/lib/mysql/mysql.pid
user = MySQL
Default_storage_engine = InnoDB
# InnoDB
Innodb_buffer_pool_size = <value>
Innodb_log_file_size = <value>
innodb_file_per_table = 1
Innodb_flush_nethod = 0_direct
# MyISAM
Key_buffer_size = <value>
# log
# Log_bin
Log_error =/var/lib/mysql/mysql-error.log
Slow_query_log =/var/lib/mysql/mysql-slow.log
# Other
Tmp_table_size = 32M
Max_heap_table_size = 32M
Query_cache_type = 0
Query_cache_size = 0
Max_connections = <value>
Thread_cache = <value>
Table_cache = <value>
Open_files_limit = 65535
[Client]
Socket =/var/lib/mysql/mysql.sock
Port = 3306
# Remove Leading # To set options mainly useful for reporting servers.
# The server defaults is faster for transactions and fast selects.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
Explicit_defaults_for_timestamp
#sql_mode =no_engine_substitution,strict_trans_tables
This article is from the "1058223494" blog, please be sure to keep this source http://4708705.blog.51cto.com/4698705/1585116
Ii. MySQL configuration file template