#BEGIN CONFIG INFO
#开始配置信息
#DESCR: 4GB RAM, InnoDB only, ACID, few connections, heavy queries
#备注说明:4G内存,只有innodb,ACID事务,很少连接,大量查询。
#TYPE: SYSTEM
#类型:系统
#END CONFIG INFO
#结束配置信息
# This is a MySQL example config file for systems with 4GB of memory
#这是一个具有4GB内存的系统的MySQL示例配置文件
# running mostly MySQL using InnoDB only tables and performing complex
#主要运行MySQL只使用InnoDB表和执行复杂
# queries with few connections.
#查询很少的连接
# MySQL programs look for option files in a set of
# MySQL程序在一组文件中查找选项文件
# locations which depend on the deployment platform.
# 取决于部署平台的位置
# You can copy this option file to one of those
#您可以将此选项文件复制到其中一个
# locations. For information about these locations, see:
#位置。有关这些位置的信息,请参见:
# http://dev.mysql.com/doc/mysql/en/option-files.html
# http://dev.mysql.com/doc/mysql/en/option-files.html
# In this file, you can use all long options that a program supports.
#在这个文件中,您可以使用程序支持的所有长选项。
# If you want to know which options a program supports, run the program
#如果您想知道程序支持哪些选项,请运行程序
# with the "--help" option.
#用"帮助"选项。
# More detailed information about the individual options can also be
#关于个别选项的更详细的信息也可以是
# found in the manual.
# 在手册中找到
# The following options will be read by MySQL client applications.
# MySQL客户端应用程序将读取以下选项。
# Note that only client applications shipped by MySQL are guaranteed
#注意,只有MySQL提供的客户端应用程序是有保证的
# to read this section. If you want your own MySQL client program to
#阅读本节。如果你想要自己的MySQL客户端程序
# honor these values, you need to specify it as an option during the
#执行时,您需要将其指定为选项
# MySQL client library initialization.
# MySQL客户端库初始化。
[client]
#客户端
#password = [your_password] #超级用户root的密码(前提是为root用户设置了密码),不建议使用该参数
port = 3306 #端口号
socket = /apps/mysql-5.5.32/tmp/mysql.sock #sock文件的存储位置及文件名
# *** Application-specific options follow here ***
#应用程序特定选项如下
# The MySQL server
# MySQL服务器
[mysqld]
#服务端
# generic configuration options
#通用配置选项
port = 3306 #端口号
socket = /apps/mysql-5.5.32/tmp/mysql.sock #sock文件存放位置及文件名
# back_log is the number of connections the operating system can keep in
# back_log是操作系统可以保持的连接数
# the listen queue, before the MySQL connection manager thread has
#在MySQL连接管理器线程之前的listen队列
# processed them. If you have a very high connection rate and experience
#处理它们。如果你有非常高的连接率和经验
# "connection refused" errors, you might need to increase this value.
#"连接拒绝"错误,您可能需要增加这个值。
# Check your OS documentation for the maximum value of this parameter.
#检查操作系统文档中该参数的最大值。可以用,cat /proc/sys/net/ipv4/tcp_max_syn_backlog命令来查看
# Attempting to set back_log higher than your operating system limit
#试图将back_log设置得高于操作系统限制
# will have no effect.
#不会有任何影响。
back_log = 50 #设置back_log的连接数为50
# Don't listen on a TCP/IP port at all. This can be a security
#不要监听TCP/IP端口。这是一种安全措施
# enhancement, if all processes that need to connect to mysqld run
#增强,如果所有需要连接到mysqld的进程都运行
# on the same host. All interaction with mysqld must be made via Unix
#在同一个主机上。所有与mysqld的交互都必须通过Unix进行
# sockets or named pipes.
#套接字或命名管道。
# Note that using this option without enabling named pipes on Windows
#注意,使用此选项时不启用Windows上的命名管道
# (via the "enable-named-pipe" option) will render mysqld useless!
#(通过"启用命名管道"选项)将使mysqld失效!
#skip-networking #此参数如果开启的话,不会有端口显示(也就是说:netstat -lntup|grep 3306没有结果)
# The maximum amount of concurrent sessions the MySQL server will
# MySQL服务器的最大并发会话量
# 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.
#已达到连接限制
max_connections = 100 #设置max_connections(最大连接数)为100
# Maximum amount of errors allowed per host. If this limit is reached,
#每个主机允许的最大错误量。如果达到此限制,
# the host will be blocked from connecting to the MySQL server until
#主机将被禁止连接到MySQL服务器直到
# "FLUSH HOSTS" has been run or the server was restarted. Invalid
#"刷新主机"已被运行或服务器重新启动。无效
# passwords and other errors during the connect phase result in
#连接阶段结果中的口令和其他错误
# increasing this value. See the "Aborted_connects" status variable for
#增加这个值。请参阅"中止连接"状态变量
# global counter.
#全局计数器。
max_connect_errors = 10
#设置每个主机的连接请求异常中断的最大次数,当超过该次数,MySQL服务器将禁止host的连接请求,直到MySQL服务器重启或通过flush hosts命令清空此host的相关信息。
# The number of open tables for all threads. Increasing this value
#所有线程的打开表数。增加这个值
# increases the number of file descriptors that mysqld requires.
#增加mySQL需要的文件描述符的数量。
# 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
#在变量"打开文件限制"中允许至少4096
# section [mysqld_safe]
#[mysqld_safe]部分
table_open_cache = 2048 #设置table_open_cache=2048
# Enable external file level locking. Enabled file locking will have a
#启用外部文件级别锁定。启用的文件锁定将具有一个
# negative impact on performance, so only use it in case you have
#对性能有负面影响,所以只有在你有负面影响时才使用它
# multiple database instances running on the same files (note some
#在同一文件上运行的多个数据库实例(请注意一些
# restrictions still apply!) or if you use other software relying on
#限制仍然适用!)或如果您使用其他软件依赖
# locking MyISAM tables on file level.
#在文件级别锁定MyISAM表。
#external-locking #MySQL选项可以避免外部锁定。True为开启
# The maximum size of a query packet the server can handle as well as
#服务器能够处理的查询包的最大大小
# maximum query size server can process (Important when working with
#最大的查询大小服务器可以处理(当工作时很重要
# large BLOBs). enlarged dynamically, for each connection.
#大气泡)。为每个连接动态放大。
max_allowed_packet = 16M #指定在网络传输中一次消息传输量的最大值。系统默认值为1MB,最大值是1GB,必须设置为1024的倍数。单位为字节
# The size of the cache to hold the SQL statements for the binary log
#保存二进制日志的SQL语句的缓存大小
# during a transaction. If you often use big, multi-statement
#在一个事务。如果你经常使用大的,多语句
# transactions you can increase this value to get more performance. All
#事务您可以增加此值以获得更高的性能。所有
# statements from transactions are buffered in the binary log cache and
#事务的语句缓冲在二进制日志缓存和
# are being written to the binary log at once after the COMMIT. If the
#在提交后立即写入二进制日志。如果
# transaction is larger than this value, temporary file on disk is used
#事务大于此值,使用磁盘上的临时文件
# instead. This buffer is allocated per connection on first update
#代替。此缓冲区在第一次更新时为每个连接分配
# statement in transaction
#语句在事务
binlog_cache_size = 1M # MySQL数据库binlog日志的缓存大小
# Maximum allowed size for a single HEAP (in memory) table. This option
#内存中单个堆表的最大允许大小。这个选项
# is a protection against the accidential creation of a very large HEAP
#是防止意外创建一个非常大的堆的保护措施吗
# table which could otherwise use up all memory resources.
#否则可能耗尽所有内存资源的表。
max_heap_table_size = 64M #独立的内存表所允许的最大容量
# Size of the buffer used for doing full table scans.
#用于完成全表扫描的缓冲区大小。
# Allocated per thread, if a full scan is needed.
#如果需要全扫描,则分配每个线程。
read_buffer_size = 2M #指定用于索引的缓冲区大小,增加它可得到更好的索引处理性能。对于内存在4GB左右的服务器来说,该参数可设置为256MB或384MB
# When reading rows in sorted order after a sort, the rows are read
#在排序后按排序顺序读取行时,读取行。
# through this buffer to avoid disk seeks. You can improve ORDER BY
#通过这个缓冲区避免磁盘查找。你可以通过改进订单
# performance a lot, if set this to a high value.
#性能高,如果设置为高值。
# Allocated per thread, when needed.
#当需要时分配每个线程。
read_rnd_buffer_size = 16M #设置进行随机读的时候所使用的缓冲区。此参数和read_buffer_size所设置的Buffer相反,一个是顺序读的时候使用,一个是随机读的时候使用
# Sort buffer is used to perform sorts for some ORDER BY and GROUP BY
#排序缓冲区用于按顺序按组执行排序
# queries. If sorted data does not fit into the sort buffer, a disk
#查询。如果排序数据不适合排序缓冲区,则磁盘
# based merge sort is used instead - See the "Sort_merge_passes"
#使用基于合并排序的方法——参见"SotTyMelGeGePASS"
# status variable. Allocated per thread if sort is needed.
#状态变量。如果需要排序,则分配每个线程。
sort_buffer_size = 8M #设置查询排序时所能使用的缓冲区大小,系统默认大小为2MB。该参数对应的分配内存是每个连接独占的
# This buffer is used for the optimization of full JOINs (JOINs without
#此缓冲器用于优化完全连接(无连接)。
# indexes). Such JOINs are very bad for performance in most cases
#索引)。在大多数情况下,这样的连接对性能非常不利。
# anyway, but setting this variable to a large value reduces the
#无论如何,但是将这个变量设置为一个大的值会减少
# performance impact. See the "Select_full_join" status variable for a
#性能影响。查看"StastUpFultJoin"状态变量
# count of full JOINs. Allocated per thread if full join is found
#全连接计数。如果发现完全连接,则分配每个线程
join_buffer_size = 8M #联合查询操作所能使用的缓冲区大小,和sort_buffer_size一样,该参数对应的分配内存也是每个连接独享
# 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.)
#如果您有一个好的线程实现,则改进。
thread_cache_size = 8 #设置Thread Cache池中可以缓存的连接线程最大数量,可设置为0~16384,默认为0.这个值表示可以重新利用保存在缓存中线程的数量,
# This permits the application to give the threads system a hint for the
#这允许应用程序为线程系统提供一个提示。
# desired number of threads that should be run at the same time. This
#希望同时运行的线程数。这个
# value only makes sense on systems that support the thread_concurrency()
#在支持thulyCoprCurnCype()的系统上,只有值是有意义的。
# function call (Sun Solaris, for example).
#函数调用(例如Sun Solaris)。
# You should try [number of CPUs]*(2..4) for thread_concurrency
#您应该尝试[线程数] *(2…4)来实现线程并发。
thread_concurrency = 8 #该参数取值为服务器逻辑CPU数量(几核)x 2
# 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
#"qcCaseE.LoMyMyPrunes"状态变量检查当前值
# 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.
#减慢而不是提高性能。
query_cache_size = 64M #指定MySQL查询缓冲区的大小。可以通过在MySQL控制台观察,如果Qcache_lowmem_prunes的值非常大,
# Only cache result sets that are smaller than this limit. This is to
#只有小于此限制的缓存结果集。这是为了
# protect the query cache of a very large result set overwriting all
#保护一个非常大的结果集的查询缓存覆盖所有
# other query results.
#其他查询结果。
query_cache_limit = 2M #只有小于此设置值的结果才会被缓存
# Minimum word length to be indexed by the full text search index.
#全文检索索引索引的最小字长。
# You might wish to decrease it if you need to search for shorter words.
#如果您需要搜索较短的单词,您可能希望减少它。
# Note that you need to rebuild your FULLTEXT index, after you have
#注意,您需要重建您的全文索引。
# modified this value.
#修正了这个值。
ft_min_word_len = 4 #设置全文检索索引的最小字长
# If your system supports the memlock() function call, you might want to
#如果您的系统支持MyLoCK()函数调用,您可能需要
# enable this option while running MySQL to keep it locked in memory and
#启用此选项,同时运行MySQL以将其锁定在内存中
# to avoid potential swapping out in case of high memory pressure. Good
#以避免潜在的交换在高记忆压力的情况下。好
# for performance.
#为了表现。
#memlock
# Table type which is used by default when creating new tables, if not
#创建新表时默认使用的表类型,如果不是
# specified differently during the CREATE TABLE statement.
#在CREATETABLE语句中指定不同。
default-storage-engine = MYISAM #指定默认存储引擎为myisam
# Thread stack size to use. This amount of memory is always reserved at
#线程堆栈大小使用。此内存量总是保留在
# connection time. MySQL itself usually needs no more than 64K of
#连接时间。MySQL本身通常不需要64K
# memory, while if you use your own stack hungry UDF functions or your
#内存,如果您使用自己的堆栈饥饿的UDF函数或您的
# OS requires more stack for some operations, you might need to set this
#操作系统对某些操作需要更多的堆栈,您可能需要设置
# to a higher value.
#到更高的价值。
thread_stack = 192K #置MySQL每个线程的堆栈大小,默认值足够大,可满足普通操作。可设置范围为128KB至4GB,默认为192KB
# Set the default transaction isolation level. Levels available are:
#设置默认事务隔离级别。可用的级别为:
# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
#读未提交、读提交、可重复读取、可串行化
transaction_isolation = REPEATABLE-READ
# 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 = 64M ##设置内存临时表最大值。如果超过该值,则会将临时表写入磁盘,其范围1KB到4GB
# Enable binary logging. This is required for acting as a MASTER in a
#启用二进制日志记录。这是在A中扮演主人的需要。
# replication configuration. You also need the binary log if you need
#复制配置。如果需要的话,还需要二进制日志。
# the ability to do point in time recovery from your latest backup.
#从最新备份中恢复时间点的能力。
log-bin=mysql-bin #开启binlog
# binary logging format - mixed recommended
#二进制日志格式-混合推荐
binlog_format=mixed #指定binlog二进制日志为mixed模式
# If you're using replication with chained slaves (A->B->C), you need to
#如果使用链式奴隶进行复制(A--> B-> C),则需要
# enable this option on server B. It enables logging of updates done by
#启用服务器B上的此选项。
# the slave thread into the slave's binary log.
#从线程到从属的二进制日志。
#log_slave_updates #如何从库需要记录binlog,则使用这个参数
# Enable the full query log. Every query (even ones with incorrect
#启用完整查询日志。每一个疑问(即使是错误的)
# syntax) that the server receives will be logged. This is useful for
#服务器接收到的日志将被记录。这是有用的。
# debugging, it is usually disabled in production use.
#调试时,通常在生产中禁用。
#log
# Print warnings to the error log file. If you have any problem with
#向错误日志文件打印警告。如果你有任何问题
# MySQL you should enable logging of warnings and examine the error log
# MySQL应该启用警告日志并检查错误日志
# for possible explanations.
#可能的解释。
#log_warnings #警告日志
# Log slow queries. Slow queries are queries which take more than the
#记录慢速查询。慢速查询是比查询占用更多的查询。
# amount of time defined in "long_query_time" or which do not use
#在"LangIQuyRyTimeTimes"中定义的或不使用的时间量
# indexes well, if log_short_format is not enabled. It is normally good idea
#如果没有启用LogyStruthFrad,则索引很好。这通常是个好主意。
# to have this turned on if you frequently add new queries to the
#如果您频繁地向其添加新查询,则打开
# system.
#系统。
slow_query_log
# All queries taking more than this amount of time (in seconds) will be
#所有超过这个时间(秒)的查询将是
# trated as slow. Do not use "1" as a value here, as this will result in
#变慢了。不要在这里使用"1"作为一个值,因为这将导致
# even very fast queries being logged from time to time (as MySQL
#即使是非常快的查询也会不时记录(如MySQL)
# currently measures time with second accuracy only).
#目前测量时间仅为二次精度。
long_query_time = 2 #超过多长时间的查询,记录到慢查询日志中,这里设置的是2秒
# *** Replication related settings
#复制相关设置
# Unique server identification number between 1 and 2^32-1. This value
#唯一的服务器标识号介于1和2 ^ 32 -1之间。这个值
# is required for both master and slave hosts. It defaults to 1 if
#主从主机都需要。默认为1
# "master-host" is not set, but will MySQL will not function as a master
#"主主机"未设置,但MySQL将不能作为主机运行。
# if it is omitted.
#如果省略。
server-id = 1 #server-id为1,主人复制时,server-id号不能相同
# Replication Slave (comment out master section to use this)
#复制从程序(注释掉主程序)
# To configure this host as a replication slave, you can choose between
#要将此主机配置为复制从属服务器,您可以选择
# two methods :
#两种方法:
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# 使用更改主命令(完全在我们的手册中描述)-
# the syntax is:
# 语法是:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# 将MASTER改为MASTER_HOST=, MASTER_PORT=,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
# 主人。- < > > =<密码> > =
# where you replace <host>, <user>, <password> by quoted strings and
# 用引号括起来的字符串替换, ,
# <port> by the master's port number (3306 by default).
# <端口>由主端口号(默认为3306)。
# Example:
# 例子:
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# 将MASTER改为MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# changes in this file to the variable values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
# Make the slave read-only. Only users with the SUPER privilege and the
# replication slave thread will be able to modify data on it. You can
# use this to ensure that no applications will accidently modify data on
# the slave instead of the master
#read_only
#*** MyISAM Specific options
# MyISAM特定选项
# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
#键缓冲区的大小,用于缓存MyISAM表的索引块。
# Do not set it larger than 30% of your available memory, as some memory
#不要将它设置为大于30%的可用内存,就像某些内存一样
# is also required by the OS to cache rows. Even if you're not using
#操作系统还需要缓存行。即使你不使用
# MyISAM tables, you should still set it to 8-64M as it will also be
# MyISAM表,您应该仍然将它设置为8-64M
# used for internal temporary disk tables.
#用于内部临时磁盘表。
key_buffer_size = 32M #指定用于索引的缓冲区大小,增加它可得到更好的索引处理性能。对于内存在4GB左右的服务器来说,该参数可设置为256MB或384MB
# MyISAM uses special tree-like cache to make bulk inserts (that is,
# MyISAM使用特殊的树状缓存进行批量插入(即,
# INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA
#插入……选择、插入……价值观(…),(…),…,加载数据
# INFILE) faster. This variable limits the size of the cache tree in
# INFILE)快。这个变量限制了缓存树的大小
# bytes per thread. Setting it to 0 will disable this optimisation. Do
#字节每个线程。将其设置为0将禁用此优化。做
# not set it larger than "key_buffer_size" for optimal performance.
#不要将其设置为大于"key_buffer_size"以获得最佳性能。
# This buffer is allocated when a bulk insert is detected.
#当检测到批量插入时,将分配此缓冲区。
bulk_insert_buffer_size = 64M
# This buffer is allocated when MySQL needs to rebuild the index in
#当MySQL需要重新构建索引时,将分配此缓冲区
# REPAIR, OPTIMIZE, ALTER table statements as well as in LOAD DATA INFILE
#修复,优化,修改表语句以及加载数据文件
# into an empty table. It is allocated per thread so be careful with
#变成一张空桌子。它是每个线程分配的,所以要小心
# large settings.
#大的设置。
myisam_sort_buffer_size = 128M
# The maximum size of the temporary file MySQL is allowed to use while
#允许使用临时文件MySQL的最大大小
# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
#重新创建索引(在修复期间,修改表或加载数据INFILE。
# If the file-size would be bigger than this, the index will be created
#如果文件大小大于这个值,就会创建索引
# through the key cache (which is slower).
#通过密钥缓存(比较慢)。
myisam_max_sort_file_size = 10G
# If a table has more than one index, MyISAM can use more than one
#如果一个表有多个索引,MyISAM可以使用多个索引
# thread to repair them by sorting in parallel. This makes sense if you
#通过并行排序修复它们的线程。如果你
# have multiple CPUs and plenty of memory.
#拥有多个cpu和大量内存。
myisam_repair_threads = 1
# Automatically check and repair not properly closed MyISAM tables.
#自动检查和修复未正确关闭的MyISAM表。
myisam_recover
# *** INNODB Specific options ***
# INNODB特定选项
# Use this option if you have a MySQL server with InnoDB support enabled
#如果MySQL服务器启用了InnoDB支持,请使用此选项
# 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
# InnoDB用来存储元数据的额外内存池
# information. If InnoDB requires more memory for this purpose it will
#信息。如果InnoDB为此需要更多的内存,它就会这么做
# 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状态将显示当前使用量。
innodb_additional_mem_pool_size = 16M
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
#与MyISAM不同,InnoDB使用缓冲池缓存索引和索引
# row data. The bigger you set this the less disk I/O is needed to
#行数据。设置越大,需要的磁盘I/O就越少
# 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
#参数高达机器物理内存大小的80%。不要设置它
# too large, though, because competition of the physical memory may
#但是太大了,因为物理内存的竞争可能
# cause paging in the operating system. Note that on 32bit systems you
#导致操作系统中的分页。请注意在32位系统上
# might be limited to 2-3.5G of user level memory per process, so do not
#每个进程的用户级内存可能限制在2-3.5G,所以不要这样做
# set it too high.
#设置得太高。
innodb_buffer_pool_size = 2G
# InnoDB stores data in one or more data files forming the tablespace.
# InnoDB将数据存储在一个或多个数据文件中,形成表空间。
# If you have a single logical drive for your data, a single
#如果数据只有一个逻辑驱动器,一个逻辑驱动器
# autoextending file would be good enough. In other cases, a single file
#自动扩展文件就足够了。在其他情况下,一个文件
# per device is often a good choice. You can configure InnoDB to use raw
#每台设备通常是一个不错的选择。您可以将InnoDB配置为raw
# disk partitions as well - please refer to the manual for more info
#磁盘分区也一样——更多信息请参考手册
# about this.
#关于这个
innodb_data_file_path = ibdata1:10M:autoextend
# Set this option if you would like the InnoDB tablespace files to be
#如果您想要InnoDB表空间文件,请设置此选项
# stored in another location. By default this is the MySQL datadir.
#存储在另一个位置。默认情况下,这是MySQL datadir。
#innodb_data_home_dir = <directory>
# Number of IO threads to use for async IO operations. This value is
#用于异步IO操作的IO线程数。这个值是
# hardcoded to 8 on Unix, but on Windows disk I/O may benefit from a
#在Unix上硬编码为8,但在Windows磁盘I/O上可能受益于a
# larger number.
innodb_write_io_threads = 8
innodb_read_io_threads = 8
# If you run into InnoDB tablespace corruption, setting this to a nonzero
#如果遇到InnoDB表空间损坏,将其设置为非零
# value will likely help you to dump your tables. Start from value 1 and
# value可能会帮助您转储表。从值1和开始
# increase it until you're able to dump the table successfully.
#增加它,直到您能够成功地转储表为止。
#innodb_force_recovery=1
# Number of threads allowed inside the InnoDB kernel. The optimal value
# InnoDB内核中允许的线程数。最优值
# 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 = 16
# If set to 1, InnoDB will flush (fsync) the transaction logs to the
#如果设置为1,InnoDB将刷新(fsync)事务日志
# disk at each commit, which offers full ACID behavior. If you are
#在每次提交时使用磁盘,这提供了完全的ACID行为。如果你是
# 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 the
#事务,您可以将其设置为0或2,以将磁盘I/O减少为
# logs. Value 0 means that the log is only written to the log file and
#日志值0意味着日志只写到日志文件和
# the log file flushed to disk approximately once per second. Value 2
#日志文件大约每秒刷新一次磁盘。值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 = 1
# Speed up InnoDB shutdown. This will disable InnoDB to do a full purge
#加速InnoDB关闭。这将使InnoDB无法执行完全清除
# and insert buffer merge on shutdown. It may increase shutdown time a
#关闭时插入缓冲区合并。可能会增加停机时间a
# lot, but InnoDB will have to do it on the next startup instead.
#很多,但InnoDB会在下次创业时做。
#innodb_fast_shutdown
# The size of the buffer InnoDB uses for buffering log data. As soon as
# InnoDB缓冲日志数据的大小。一旦
# it is full, InnoDB will have to flush it to disk. As it is flushed
#它是满的,InnoDB将不得不将它刷新到磁盘。当它被刷新时
# once per second anyway, it does not make sense to have it very large
#不管怎样,每秒一次,让它非常大是没有意义的
# (even with long transactions).
#(即使交易时间很长)。
innodb_log_buffer_size = 8M
# 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
#要避免将日志文件的大小限制在缓冲池大小的25%-100%之间
# unneeded buffer pool flush activity on log file overwrite. However,
#日志文件覆盖上不需要的缓冲池刷新活动。然而,
# note that a larger logfile size will increase the time needed for the
#请注意,较大的日志文件大小将增加所需的时间
# recovery process.
#回收过程。
innodb_log_file_size = 256M
# Total number of files in the log group. A value of 2-3 is usually good
#日志组中的文件总数。2-3的值通常是好的。
# enough.
#够了。
innodb_log_files_in_group = 3
# Location of the InnoDB log files. Default is the MySQL datadir. You
# YNODB日志文件的位置。默认是MySQL DATADIR。你
# may wish to point it to a dedicated hard drive or a RAID1 volume for
#可能希望指向一个专用硬盘驱动器或RAID1卷
# improved performance
#改进性能
#innodb_log_group_home_dir
# Maximum allowed percentage of dirty pages in the InnoDB buffer pool.
# UnIDB缓冲池中脏页的最大允许百分比。
# If it is reached, InnoDB will start flushing them out agressively to
#如果到达,NYNDB将开始将它们冲洗出来。
# not run out of clean pages at all. This is a soft limit, not
#没有耗尽干净的页面。这是一个软限制,不是
# guaranteed to be held.
#保证举行。
innodb_max_dirty_pages_pct = 90
# The flush method InnoDB will use for Log. The tablespace always uses
# UnDB的刷新方法将用于日志。表空间总是使用
# doublewrite flush logic. The default value is "fdatasync", another
#双写冲洗逻辑。默认值是"fDATAYNC",另一个是
# option is "O_DSYNC".
#选项是"O _ dsync"。
#innodb_flush_method=O_DSYNC
# How long an InnoDB transaction should wait for a lock to be granted
#一个INODB事务应该等待多长时间才能被授予一个锁
# before being rolled back. InnoDB automatically detects transaction
#在回滚之前。自动检测事务
# deadlocks in its own lock table and rolls back the transaction. If you
#死锁在自己的锁定表中,并回滚事务。如果你
# use the LOCK TABLES command, or other transaction-safe storage engines
#使用锁表命令或其他事务安全存储引擎
# than InnoDB in the same transaction, then a deadlock may arise which
#在同一事务中,UNYDB可能会出现死锁。
# InnoDB cannot notice. In cases like this the timeout is useful to
# iNONDB不能注意到。在这种情况下,超时是有用的。
# resolve the situation.
#解决局面。
innodb_lock_wait_timeout = 120
[mysqldump]
# Do not buffer the whole result set in memory before writing it to
#在写入内存之前,不将整个结果集缓存在内存中。
# file. Required for dumping very large tables
#文件。倾倒非常大桌子需要
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash #仅仅允许使用键值的updates和deletes
# Only allow UPDATEs and DELETEs that use keys.
#只允许使用密钥的更新和删除。
#safe-updates
[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
# Increase the amount of open files allowed per process. Warning: Make
#增加每个进程允许的打开文件数量。警告:使
# sure you have set the global system limit high enough! The high value
#当然,您已经设置了全球系统限制足够高!高价值
# is required for a large number of opened tables
#对于大量打开的表是必需的
open-files-limit = 8192 #MySQL能打开文件的最大个数,如果出现too mant open files之类的就需要调整该值了