The mysql configuration file on the server is only for reference and record.
# MySQL Server Instance Configuration File
#----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
#----------------------------------------------------------------------
#
# On Linux you can copy this file to/etc/my. cnf to set global options,
# Mysql-data-dir/my. cnf to set server-specific options
# (@ Localstatedir @ for this installation) or
#~ /. My. cnf to set user-specific options.
#
# On Windows you shoshould keep this file in the installation directory
# Of your server (e.g. C: \ Program Files \ MySQL Server X.Y).
# Make sure the server reads the config file use the startup option
# "-- Defaults-file ".
#
# To run the server from the command line, execute this in
# Command line shell, e.g.
# Mysqld -- defaults-file = "C: \ Program Files \ MySQL Server X.Y \ my. ini"
#
# To install the server as a Windows service manually, execute this in
# Command line shell, e.g.
# Mysqld -- install MySQLXY -- defaults-file = "C: \ Program Files \ MySQL Server X.Y \ my. ini"
#
# And then execute this in a command line shell to start the server, e.g.
# Net start MySQLXY
#
#
# Guildlines for editing this file
#----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# With the "-- help" option.
#
# More detailed information about the individual options can also be
# Found in the manual.
#
#
# CLIENT SECTION
#----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications are shipped by MySQL are guaranteed
# To read this section. If you want your own MySQL client program
# Honor these values, you need to specify it as an option during
# MySQL client library initialization.
#
[Client]
Port = 3366
[Mysql]
Default-character-set = utf8
# SERVER SECTION
#----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# You have installed the server correctly (see above) so it reads this
# File.
#
[Mysqld]
# The TCP/IP Port the MySQL Server will listen on
Port = 3366
# Path to installation directory. All paths are usually resolved relative to this.
Basedir = "E:/MySQL Server 5.1 /"
# Path to the database root
Datadir = "E:/MySQLdb/Data /"
# The default character set that will be used when a new schema or table is
# Created and no character set is defined
Default-character-set = utf8
# The default storage engine that will be used when create new tables when
Default-storage-engine = INNODB
# Set the SQL mode to strict
SQL-mode = "STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION"
# The maximum amount of concurrent sessions the MySQL server will
# Allow. One of these connections will be reserved for a user
# SUPER privileges to allow the administrator to login even if
# Connection limit has been reached.
Max_connections = 200
# 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 = 64 M
# The number of open tables for all threads. Increasing this value
# Increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# Allowed to at least 4096 in the variable "open-files-limit" in
# Section [mysqld_safe]
Table_cache = 512
# 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 = 64 M
# How many threads we shoshould keep in a cache for reuse. When a client
# Disconnects, the client's threads are put in the cache if there aren't
# More than thread_cache_size threads from before. This greatly CES
# The amount of thread creations needed if you have a lot of new
# Connections. (Normally this doesn't give a notable performance
# Improvement if you have a good thread implementation .)
Thread_cache_size = 16
# *** MyISAM Specific options
# The maximum size of the temporary file MySQL is allowed to use while
# Recreating the index (during REPAIR, alter table or load data infile.
# If the file-size wocould be bigger than this, the index will be created
# Through the key cache (which is slower ).
Myisam_max_sort_file_size = 100G
# 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 = 64 M
# 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 = 256 M
# Size of the buffer used for doing full table scans of MyISAM tables.
# Allocated per thread, if a full scan is needed.
Read_buffer_size = 2 M
Read_rnd_buffer_size = 8 M
# This buffer is allocated when MySQL needs to rebuild the index in
# REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE
# Into an empty table. It is allocated per thread so be careful
# Large settings.
Sort_buffer_size = 2 M
# *** INNODB Specific options ***
# Use this option if you have a MySQL server with InnoDB support enabled
# But you do not plan to use it. This will save memory and disk space
# And speed up some things.
# Skip-innodb
# Additional memory pool that is used by InnoDB to store metadata
# Information. If InnoDB requires more memory for this purpose it will
# Start to allocate it from the OS. As this is fast enough on most
# Recent operating systems, you normally do not need to change this
# Value. show innodb status will display the current amount used.
Innodb_additional_mem_pool_size = 20 M
# If set to 1, InnoDB will flush (fsync) the transaction logs to
# Disk at each commit, which offers full ACID behavior. If you are
# Willing to compromise this safety, and you are running small
# Transactions, you may set this to 0 or 2 to reduce disk I/O to
# Logs. Value 0 means that the log is only written to the log file and
# The log file flushed to disk approximately once per second. Value 2
# Means the log is written to the log file at each commit, but the log
# File is only flushed to disk approximately once per second.
Innodb_flush_log_at_trx_commit = 0
# The size of the buffer InnoDB uses for buffering log data. As soon
# It is full, InnoDB will have to flush it to disk. As it is flushed
# Once per second anyway, it does not make sense to have it very large
# (Even with long transactions ).
Innodb_log_buffer_size = 8 M
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# Row data. The bigger you set this the less disk I/O is needed
# Access data in tables. On a dedicated database server you may set this
# Parameter up to 80% of the machine physical memory size. Do not set it
# Too large, though, because competition of the physical memory may
# Cause paging in the operating system. Note that on 32bit systems you
# Might be limited to 2-3.5G of user level memory per process, so do not
# Set it too high.
Innodb_buffer_pool_size = 512 M
# Size of each log file in a log group. You should set the combined size
# Of log files to about 25%-100% of your buffer pool size to avoid
# Unneeded buffer pool flush activity on log file overwrite. However,
# Note that a larger logfile size will increase the time needed for
# Recovery process.
Innodb_log_file_size = 256 M
# Number of threads allowed inside the InnoDB kernel. The optimal value
# Depends highly on the application, hardware as well as the OS
# Scheduler properties. A too high value may lead to thread thrashing.
Innodb_thread_concurrency = 4
Max_allowed_packet = 8 M
Net_buffer_length = 8 K
Join_buffer_size = 2 M
Query_cache_limit = 2 M
Innodb_lock_wait_timeout = 50
Back_log = 1024
Slow_query_log = 1
Log_output = FILE
Slow_query_log_file = mysql_slow.log
Long_query_time = 2
Innodb_support_xa = 0
Concurrent_insert = 2
This article is from the "ethereal yunlu" blog