home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 March (DVD) / PCWorld_2008-03_DVD.iso / komunikace / mysql / mysql-essential-5.0.45-win32.msi / product.cab / dfile1 next >
Encoding:
Text File  |  2006-04-19  |  13.2 KB  |  308 lines

  1. ## MySQL Server Instance Configuration File Template
  2. ## ----------------------------------------------------------------------
  3. ## Version 1.0.2
  4. ##
  5. ## Lines that starts like this are comments and wont be put in the output.
  6. ## Normal comments are output.
  7. ##
  8. ## Replaceable things must be like:
  9. ## 
  10. ## <<{:=1+1}>>
  11. ##
  12. ## You can put more than one optional expression one after another.
  13. ## The option to be picked is the one that contains the correct
  14. ## config option tag before the : You can specify multiple optional 
  15. ## tags by separating them with a |  Example:
  16. ##
  17. ## <<{:=1+1}{:BLA|BLE=1+[one]}>>
  18. ##
  19. ## An empty tag is the default value.
  20. ##
  21. ## All expressions are evaluated as doubles, but rounded to integers.
  22. ## 
  23. ## If you don't put a = after the :, the remaining expression will be
  24. ## interpreted as a string and variables will be simply replaced.
  25. ##
  26. ## If an expression is enclosed with <<< >>> (instead of << >>), the
  27. ## line will not be written to the output file. You can use that for
  28. ## temporary variables.
  29. ##
  30. ## You can put the following flags between : and = for arithmetical
  31. ## expressions:
  32. ##  R - round to nearest multiple of 1000
  33. ##  K - round to nearest multiple of 1K or 1M or 1G
  34. ##  M - take max value, from list separated by commas
  35. ##  m - same for min
  36. ##  N - allow negative result.
  37. ##
  38. ## pick appropriate values for these
  39. _memory=<<<{SERVER:K=[MEMORY]/2}{DEDICATED:K=[MEMORY]*90/100}{:MK=[MEMORY]/12,48M}>>>
  40. _myisam_pct=<<<{MYISAM:=100}{INNODB:=5}{USERDEF_DB:=[myisam_pct]}{:=50}>>>
  41. _active_connections=<<<{DSS:=20}{OLTP:=500}{:=[active_connections]}>>>
  42. _over_commit_factor=<<<{:=10}>>>
  43. _over_commit_factor2=<<<{:=10}>>>
  44. ##
  45. ##
  46. ##
  47. # MySQL Server Instance Configuration File
  48. # ----------------------------------------------------------------------
  49. # Generated by the MySQL Server Instance Configuration Wizard
  50. #
  51. #
  52. # Installation Instructions
  53. # ----------------------------------------------------------------------
  54. #
  55. # On Linux you can copy this file to /etc/my.cnf to set global options,
  56. # mysql-data-dir/my.cnf to set server-specific options
  57. # (@localstatedir@ for this installation) or to
  58. # ~/.my.cnf to set user-specific options.
  59. #
  60. # On Windows you should keep this file in the installation directory 
  61. # of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
  62. # make sure the server reads the config file use the startup option 
  63. # "--defaults-file". 
  64. #
  65. # To run run the server from the command line, execute this in a 
  66. # command line shell, e.g.
  67. # mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
  68. #
  69. # To install the server as a Windows service manually, execute this in a 
  70. # command line shell, e.g.
  71. # mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
  72. #
  73. # And then execute this in a command line shell to start the server, e.g.
  74. # net start MySQLXY
  75. #
  76. #
  77. # Guildlines for editing this file
  78. # ----------------------------------------------------------------------
  79. #
  80. # In this file, you can use all long options that the program supports.
  81. # If you want to know the options a program supports, start the program
  82. # with the "--help" option.
  83. #
  84. # More detailed information about the individual options can also be
  85. # found in the manual.
  86. #
  87. #
  88. # CLIENT SECTION
  89. # ----------------------------------------------------------------------
  90. #
  91. # The following options will be read by MySQL client applications.
  92. # Note that only client applications shipped by MySQL are guaranteed
  93. # to read this section. If you want your own MySQL client program to
  94. # honor these values, you need to specify it as an option during the
  95. # MySQL client library initialization.
  96. #
  97. [client]
  98.  
  99. <<ifdef SKIPNETWORKING>>
  100. pipe
  101. socket=mysql
  102. <<else>>
  103. port=<<{:=[port]}>>
  104. <<endif>>
  105.  
  106. [mysql]
  107.  
  108. default-character-set=<<{:[default-character-set]}>>
  109.  
  110.  
  111. # SERVER SECTION
  112. # ----------------------------------------------------------------------
  113. #
  114. # The following options will be read by the MySQL Server. Make sure that
  115. # you have installed the server correctly (see above) so it reads this 
  116. # file.
  117. #
  118. [mysqld]
  119.  
  120. <<ifdef SKIPNETWORKING>>
  121. skip-networking
  122. enable-named-pipe
  123.  
  124. # The Pipe the MySQL Server will use
  125. socket=mysql
  126. <<else>>
  127. # The TCP/IP Port the MySQL Server will listen on
  128. port=<<{:=[port]}>>
  129. <<endif>>
  130.  
  131.  
  132. #Path to installation directory. All paths are usually resolved relative to this.
  133. basedir=<<{:[basedir]}>>
  134.  
  135. #Path to the database root
  136. datadir=<<{:[datadir]}>>
  137.  
  138. # The default character set that will be used when a new schema or table is
  139. # created and no character set is defined
  140. default-character-set=<<{:[default-character-set]}>>
  141.  
  142. # The default storage engine that will be used when create new tables when
  143. default-storage-engine=<<{MIXED|INNODB:INNODB}{:MYISAM}>>
  144.  
  145. <<ifdef STRICTMODE>>
  146. # Set the SQL mode to strict
  147. sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
  148. <<endif>>
  149.  
  150. # The maximum amount of concurrent sessions the MySQL server will
  151. # allow. One of these connections will be reserved for a user with
  152. # SUPER privileges to allow the administrator to login even if the
  153. # connection limit has been reached.
  154. _max_connections=<<<{:Rm=([_active_connections]*3)/2+10,[_memory]/512K}>>>
  155. max_connections=<<{:RM=100,[_max_connections]}>>
  156. ##
  157. _available_memory=<<<{:=[_memory]-[max_connections]*256K}>>>
  158.  
  159. # Query cache is used to cache SELECT results and later return them
  160. # without actual executing the same query once again. Having the query
  161. # cache enabled may result in significant speed improvements, if your
  162. # have a lot of identical queries and rarely changing tables. See the
  163. # "Qcache_lowmem_prunes" status variable to check if the current value
  164. # is high enough for your load.
  165. # Note: In case your tables change very often or if your queries are
  166. # textually different every time, the query cache may result in a
  167. # slowdown instead of a performance improvement.
  168. query_cache_size=<<{DSS:=0}{:KM=[_available_memory]/10,8M}>>
  169. ##
  170. _available_memory=<<<{:=[_available_memory]-[query_cache_size]}>>>
  171. _buffers_memory=<<<{:=([_available_memory]*7)/10}>>>
  172. _thread_buffers_memory=<<<{:=([_available_memory]*3)/10}>>>
  173. _memory_per_thread=<<<{:=[_thread_buffers_memory]*[_over_commit_factor]/[max_connections]}>>>
  174.  
  175. # The number of open tables for all threads. Increasing this value
  176. # increases the number of file descriptors that mysqld requires.
  177. # Therefore you have to make sure to set the amount of open files
  178. # allowed to at least 4096 in the variable "open-files-limit" in
  179. # section [mysqld_safe]
  180. table_cache=<<{:RM=256,[max_connections]*2}>>
  181. ##
  182. _buffers_memory=<<<{:=[_buffers_memory]-[table_cache]*8K}>>>
  183.  
  184. # Maximum size for internal (in-memory) temporary tables. If a table
  185. # grows larger than this value, it is automatically converted to disk
  186. # based table This limitation is for a single table. There can be many
  187. # of them.
  188. _big_thread_buffers=<<<{:=[_memory_per_thread]*[_over_commit_factor2]}>>>
  189. _tmp_table_size=<<<{:KM=16M,[_big_thread_buffers]}>>>
  190. tmp_table_size=<<{:Km=[_tmp_table_size],[_memory]*10/100}>>
  191.  
  192.  
  193. # How many threads we should keep in a cache for reuse. When a client
  194. # disconnects, the client's threads are put in the cache if there aren't
  195. # more than thread_cache_size threads from before.  This greatly reduces
  196. # the amount of thread creations needed if you have a lot of new
  197. # connections. (Normally this doesn't give a notable performance
  198. # improvement if you have a good thread implementation.)
  199. _thread_cache=<<<{:M=([max_connections]*5)/100,8}>>>
  200. thread_cache_size=<<{:Rm=[_thread_cache],64}>>
  201.  
  202. #*** MyISAM Specific options
  203. _myisam_buffers=<<<{:=[_buffers_memory]*([_myisam_pct]/100)}>>>
  204. ##
  205.  
  206. # The maximum size of the temporary file MySQL is allowed to use while
  207. # recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
  208. # If the file-size would be bigger than this, the index will be created
  209. # through the key cache (which is slower).
  210. myisam_max_sort_file_size=<<{DEDICATED|SHARED:K=100G}{:K=100G}>>
  211.  
  212. # If the temporary file used for fast index creation would be bigger
  213. # than using the key cache by the amount specified here, then prefer the
  214. # key cache method.  This is mainly used to force long character keys in
  215. # large tables to use the slower key cache method to create the index.
  216. myisam_max_extra_sort_file_size=<<{DEDICATED|SHARED:K=100G}{:K=100G}>>
  217.  
  218. # If the temporary file used for fast index creation would be bigger
  219. # than using the key cache by the amount specified here, then prefer the
  220. # key cache method.  This is mainly used to force long character keys in
  221. # large tables to use the slower key cache method to create the index.
  222. _myisam_sort_buffer_size=<<<{:KM=8M,[_big_thread_buffers]}>>>
  223. myisam_sort_buffer_size=<<{:Km=[_myisam_sort_buffer_size],[_memory]*20/100}>>
  224.  
  225. # Size of the Key Buffer, used to cache index blocks for MyISAM tables.
  226. # Do not set it larger than 30% of your available memory, as some memory
  227. # is also required by the OS to cache rows. Even if you're not using
  228. # MyISAM tables, you should still set it to 8-64M as it will also be
  229. # used for internal temporary disk tables.
  230. key_buffer_size=<<{:KM=8M,[_myisam_buffers]/2}>>
  231.  
  232. # Size of the buffer used for doing full table scans of MyISAM tables.
  233. # Allocated per thread, if a full scan is needed.
  234. read_buffer_size=<<{:Km=64K,([_memory_per_thread]*2)/10,[_memory]/100}>>
  235. read_rnd_buffer_size=<<{:Km=256K,([_memory_per_thread]*4)/10,[_memory]*4/100}>>
  236.  
  237. # This buffer is allocated when MySQL needs to rebuild the index in
  238. # REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE
  239. # into an empty table. It is allocated per thread so be careful with
  240. # large settings.
  241. _sort_buffer_size=<<<{:Km=256K,([_memory_per_thread]*3)/10}>>>
  242. sort_buffer_size=<<{:Km=[_sort_buffer_size],[_memory]*2/100}>>
  243.  
  244.  
  245. #*** INNODB Specific options ***
  246. <<{SETINNODBHOMEDIR:[innodb_home]}{:}>>
  247. ##
  248. _innodb_buffers=<<<{:=[_buffers_memory]*(1-[_myisam_pct]/100)}>>>
  249. ##
  250.  
  251. # Use this option if you have a MySQL server with InnoDB support enabled
  252. # but you do not plan to use it. This will save memory and disk space
  253. # and speed up some things.
  254. <<{MYISAM:skip-innodb}{:#skip-innodb}>>
  255.  
  256. # Additional memory pool that is used by InnoDB to store metadata
  257. # information.  If InnoDB requires more memory for this purpose it will
  258. # start to allocate it from the OS.  As this is fast enough on most
  259. # recent operating systems, you normally do not need to change this
  260. # value. SHOW INNODB STATUS will display the current amount used.
  261. _innodb_additional_mem_pool_size=<<<{:M=2M,([_innodb_buffers]*2)/100}>>>
  262. innodb_additional_mem_pool_size=<<{:Km=32M,[_innodb_additional_mem_pool_size]}>>
  263. ##
  264. _innodb_buffers=<<<{:M=[_innodb_buffers]-[innodb_additional_mem_pool_size],0}>>>
  265.  
  266. # If set to 1, InnoDB will flush (fsync) the transaction logs to the
  267. # disk at each commit, which offers full ACID behavior. If you are
  268. # willing to compromise this safety, and you are running small
  269. # transactions, you may set this to 0 or 2 to reduce disk I/O to the
  270. # logs. Value 0 means that the log is only written to the log file and
  271. # the log file flushed to disk approximately once per second. Value 2
  272. # means the log is written to the log file at each commit, but the log
  273. # file is only flushed to disk approximately once per second.
  274. innodb_flush_log_at_trx_commit=1
  275.  
  276. # The size of the buffer InnoDB uses for buffering log data. As soon as
  277. # it is full, InnoDB will have to flush it to disk. As it is flushed
  278. # once per second anyway, it does not make sense to have it very large
  279. # (even with long transactions).
  280. _innodb_log_buffer_size=<<<{:M=1M,[_innodb_buffers]/100}>>>
  281. innodb_log_buffer_size=<<{:Km=16M,[_innodb_log_buffer_size]}>>
  282.  
  283. # InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
  284. # row data. The bigger you set this the less disk I/O is needed to
  285. # access data in tables. On a dedicated database server you may set this
  286. # parameter up to 80% of the machine physical memory size. Do not set it
  287. # too large, though, because competition of the physical memory may
  288. # cause paging in the operating system.  Note that on 32bit systems you
  289. # might be limited to 2-3.5G of user level memory per process, so do not
  290. # set it too high.
  291. innodb_buffer_pool_size=<<{:MK=[_innodb_buffers]-[innodb_log_buffer_size],8M}>>
  292.  
  293. # Size of each log file in a log group. You should set the combined size
  294. # of log files to about 25%-100% of your buffer pool size to avoid
  295. # unneeded buffer pool flush activity on log file overwrite. However,
  296. # note that a larger logfile size will increase the time needed for the
  297. # recovery process.
  298. _innodb_log_file_size=<<<{OLTP:Rm=([innodb_buffer_pool_size]*2)/10,1G}{DSS:Rm=([innodb_buffer_pool_size]*5)/10,1G}{:Rm=([innodb_buffer_pool_size]*2)/10,1G}>>>
  299. innodb_log_file_size=<<{CONFIG_ALTERED:[old_innodb_log_file_size]}{:KM=10M,[_innodb_log_file_size]}>>
  300.  
  301. # Number of threads allowed inside the InnoDB kernel. The optimal value
  302. # depends highly on the application, hardware as well as the OS
  303. # scheduler properties. A too high value may lead to thread thrashing.
  304. ## originally formula was innodb_thread_concurrency=<<{:M=8,2*([CPUS]+[DISKS])}>>
  305. ## but since only one disk will be used in a standard configuration
  306. ## [DISKS] is replaced by 1
  307. innodb_thread_concurrency=<<{:M=8,2*([CPUS]+1)}>>
  308.