Mysql My.ini详细说明(一)

2014-11-24 15:36:18 · 作者: · 浏览: 4
Mysql My.ini详细说明
CLIENT SECTION
客户端章节:
[client]
port=3306 端口号=3306
[mysql]
default-character-set=latin1 默认字符编码=latin1
SERVER SECTION
服务端章节
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
TCP/IP Port 监听mysql的端口号
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
安装目录路径 。所有的路径都是作为这个路径的相对路径。
basedir="E:/programfile/MySql5.1/"
#Path to the database root
数据库数据的根路径
datadir="C:/ProgramData/MySQL/MySQL Server 5.1/Data/"
# The default character set that will be used when a new schema or table is
# created and no character set is defined
默认的字符集编码作用于当一个新的schema 或者表被创建的时候没有指定字符集。
default-character-set=latin1
# The default storage engine that will be used when create new tables when
默认的存储引擎作用于当创建新表的时候
default-storage-engine=INNODB
# Set the SQL mode to strict
设置严格的SQL模型
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 with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
Mysql 服务端允许最大的并发数,其中一个连接将留给用户使用超级权限连接数据库,即使连接数已经达到最高限额
max_connections=100
# 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 the
# "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 a
# slowdown instead of a performance improvement.
查询缓存用于在缓存中SELECT结果,返回不是实际查询数据库的结果。
从缓存中查询的结果会显著的提升查询速度,如果你有很多相同的查询和很少改变表结构。
查看“Qcache_lowmem_prunes”状态变量来检查当前值对于你的负载是否足够高。
NOTE:如果你的表结构经常改变或者,你每次查询都不相同,那么使用查询缓存结果可能不是一个性能改进。
query_cache_size=15M
# 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=256
# 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 many
# of them.
临时表最大内存大小。如果一个表生长大于这个值,它会自动转换为磁盘,这只是限制单个表,可以有很多个
tmp_table_size=18M
# How many threads we should 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 reduces
# 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.)
有很多线程我们应该保持在一个缓存里以便重用。在没有超过超过线程缓存大小之前,当一个客户端断开连接时,把客户端线程放在缓存中。如果你有很多新的连接,那么