Advertisement
Guest User

Untitled

a guest
Feb 11th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.48 KB | None | 0 0
  1. bin\mysqld --install mysql --defaults-file="%cd%\bin\my.ini"
  2. #BEGIN CONFIG INFO
  3. #DESCR: 4GB RAM, InnoDB only, ACID, few connections, heavy queries
  4. #TYPE: SYSTEM
  5. #END CONFIG INFO
  6.  
  7. #
  8. # This is a MariaDB example config file for systems with 4GB of memory
  9. # running mostly MariaDB using InnoDB only tables and performing complex
  10. # queries with few connections.
  11. #
  12. # MariaDB programs look for option files in a set of
  13. # locations which depend on the deployment platform.
  14. # You can copy this option file to one of those
  15. # locations. For information about these locations, do:
  16. # 'my_print_defaults --help' and see what is printed under
  17. # Default options are read from the following files in the given order:
  18. # More information at: http://dev.mysql.com/doc/mysql/en/option-files.html
  19. #
  20. # In this file, you can use all long options that a program supports.
  21. # If you want to know which options a program supports, run the program
  22. # with the "--help" option.
  23. #
  24. # More detailed information about the individual options can also be
  25. # found in the manual.
  26. #
  27.  
  28. #
  29. # The following options will be read by MariaDB client applications.
  30. # Note that only client applications shipped by MariaDB are guaranteed
  31. # to read this section. If you want your own MariaDB client program to
  32. # honor these values, you need to specify it as an option during the
  33. # MariaDB client library initialization.
  34. #
  35. [client]
  36. #password = [your_password]
  37. port = 3306
  38. socket = /tmp/mysql.sock
  39.  
  40. # *** Application-specific options follow here ***
  41.  
  42. #
  43. # The MariaDB server
  44. #
  45. [mysqld]
  46.  
  47. # generic configuration options
  48. port = 3306
  49. socket = /tmp/mysql.sock
  50.  
  51. # back_log is the number of connections the operating system can keep in
  52. # the listen queue, before the MariaDB connection manager thread has
  53. # processed them. If you have a very high connection rate and experience
  54. # "connection refused" errors, you might need to increase this value.
  55. # Check your OS documentation for the maximum value of this parameter.
  56. # Attempting to set back_log higher than your operating system limit
  57. # will have no effect.
  58. back_log = 50
  59.  
  60. # Don't listen on a TCP/IP port at all. This can be a security
  61. # enhancement, if all processes that need to connect to mysqld run
  62. # on the same host. All interaction with mysqld must be made via Unix
  63. # sockets or named pipes.
  64. # Note that using this option without enabling named pipes on Windows
  65. # (via the "enable-named-pipe" option) will render mysqld useless!
  66. #skip-networking
  67.  
  68. # The maximum amount of concurrent sessions the MariaDB server will
  69. # allow. One of these connections will be reserved for a user with
  70. # SUPER privileges to allow the administrator to login even if the
  71. # connection limit has been reached.
  72. max_connections = 100
  73.  
  74. # Maximum amount of errors allowed per host. If this limit is reached,
  75. # the host will be blocked from connecting to the MariaDB server until
  76. # "FLUSH HOSTS" has been run or the server was restarted. Invalid
  77. # passwords and other errors during the connect phase result in
  78. # increasing this value. See the "Aborted_connects" status variable for
  79. # global counter.
  80. max_connect_errors = 10
  81.  
  82. # The number of open tables for all threads. Increasing this value
  83. # increases the number of file descriptors that mysqld requires.
  84. # Therefore you have to make sure to set the amount of open files
  85. # allowed to at least 4096 in the variable "open-files-limit" in
  86. # section [mysqld_safe]
  87. table_open_cache = 2048
  88.  
  89. # Enable external file level locking. Enabled file locking will have a
  90. # negative impact on performance, so only use it in case you have
  91. # multiple database instances running on the same files (note some
  92. # restrictions still apply!) or if you use other software relying on
  93. # locking MyISAM tables on file level.
  94. #external-locking
  95.  
  96. # The maximum size of a query packet the server can handle as well as
  97. # maximum query size server can process (Important when working with
  98. # large BLOBs). enlarged dynamically, for each connection.
  99. max_allowed_packet = 16M
  100.  
  101. # The size of the cache to hold the SQL statements for the binary log
  102. # during a transaction. If you often use big, multi-statement
  103. # transactions you can increase this value to get more performance. All
  104. # statements from transactions are buffered in the binary log cache and
  105. # are being written to the binary log at once after the COMMIT. If the
  106. # transaction is larger than this value, temporary file on disk is used
  107. # instead. This buffer is allocated per connection on first update
  108. # statement in transaction
  109. binlog_cache_size = 1M
  110.  
  111. # Maximum allowed size for a single HEAP (in memory) table. This option
  112. # is a protection against the accidential creation of a very large HEAP
  113. # table which could otherwise use up all memory resources.
  114. max_heap_table_size = 64M
  115.  
  116. # Size of the buffer used for doing full table scans.
  117. # Allocated per thread, if a full scan is needed.
  118. read_buffer_size = 2M
  119.  
  120. # When reading rows in sorted order after a sort, the rows are read
  121. # through this buffer to avoid disk seeks. You can improve ORDER BY
  122. # performance a lot, if set this to a high value.
  123. # Allocated per thread, when needed.
  124. read_rnd_buffer_size = 16M
  125.  
  126. # Sort buffer is used to perform sorts for some ORDER BY and GROUP BY
  127. # queries. If sorted data does not fit into the sort buffer, a disk
  128. # based merge sort is used instead - See the "Sort_merge_passes"
  129. # status variable. Allocated per thread if sort is needed.
  130. sort_buffer_size = 8M
  131.  
  132. # This buffer is used for the optimization of full JOINs (JOINs without
  133. # indexes). Such JOINs are very bad for performance in most cases
  134. # anyway, but setting this variable to a large value reduces the
  135. # performance impact. See the "Select_full_join" status variable for a
  136. # count of full JOINs. Allocated per thread if full join is found
  137. join_buffer_size = 8M
  138.  
  139. # How many threads we should keep in a cache for reuse. When a client
  140. # disconnects, the client's threads are put in the cache if there aren't
  141. # more than thread_cache_size threads from before. This greatly reduces
  142. # the amount of thread creations needed if you have a lot of new
  143. # connections. (Normally this doesn't give a notable performance
  144. # improvement if you have a good thread implementation.)
  145. thread_cache_size = 8
  146.  
  147. # This permits the application to give the threads system a hint for the
  148. # desired number of threads that should be run at the same time. This
  149. # value only makes sense on systems that support the thread_concurrency()
  150. # function call (Sun Solaris, for example).
  151. # You should try [number of CPUs]*(2..4) for thread_concurrency
  152. thread_concurrency = 8
  153.  
  154. # Query cache is used to cache SELECT results and later return them
  155. # without actual executing the same query once again. Having the query
  156. # cache enabled may result in significant speed improvements, if your
  157. # have a lot of identical queries and rarely changing tables. See the
  158. # "Qcache_lowmem_prunes" status variable to check if the current value
  159. # is high enough for your load.
  160. # Note: In case your tables change very often or if your queries are
  161. # textually different every time, the query cache may result in a
  162. # slowdown instead of a performance improvement.
  163. query_cache_size = 64M
  164.  
  165. # Only cache result sets that are smaller than this limit. This is to
  166. # protect the query cache of a very large result set overwriting all
  167. # other query results.
  168. query_cache_limit = 2M
  169.  
  170. # Minimum word length to be indexed by the full text search index.
  171. # You might wish to decrease it if you need to search for shorter words.
  172. # Note that you need to rebuild your FULLTEXT index, after you have
  173. # modified this value.
  174. ft_min_word_len = 4
  175.  
  176. # If your system supports the memlock() function call, you might want to
  177. # enable this option while running MariaDB to keep it locked in memory and
  178. # to avoid potential swapping out in case of high memory pressure. Good
  179. # for performance.
  180. #memlock
  181.  
  182. # Table type which is used by default when creating new tables, if not
  183. # specified differently during the CREATE TABLE statement.
  184. default-storage-engine = MYISAM
  185.  
  186. # Thread stack size to use. This amount of memory is always reserved at
  187. # connection time. MariaDB itself usually needs no more than 64K of
  188. # memory, while if you use your own stack hungry UDF functions or your
  189. # OS requires more stack for some operations, you might need to set this
  190. # to a higher value.
  191. thread_stack = 240K
  192.  
  193. # Set the default transaction isolation level. Levels available are:
  194. # READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
  195. transaction_isolation = REPEATABLE-READ
  196.  
  197. # Maximum size for internal (in-memory) temporary tables. If a table
  198. # grows larger than this value, it is automatically converted to disk
  199. # based table This limitation is for a single table. There can be many
  200. # of them.
  201. tmp_table_size = 64M
  202.  
  203. # Enable binary logging. This is required for acting as a MASTER in a
  204. # replication configuration. You also need the binary log if you need
  205. # the ability to do point in time recovery from your latest backup.
  206. log-bin=mysql-bin
  207.  
  208. # binary logging format - mixed recommended
  209. binlog_format=mixed
  210.  
  211. # If you're using replication with chained slaves (A->B->C), you need to
  212. # enable this option on server B. It enables logging of updates done by
  213. # the slave thread into the slave's binary log.
  214. #log_slave_updates
  215.  
  216. # Enable the full query log. Every query (even ones with incorrect
  217. # syntax) that the server receives will be logged. This is useful for
  218. # debugging, it is usually disabled in production use.
  219. #log
  220.  
  221. # Print warnings to the error log file. If you have any problem with
  222. # MariaDB you should enable logging of warnings and examine the error log
  223. # for possible explanations.
  224. #log_warnings
  225.  
  226. # Log slow queries. Slow queries are queries which take more than the
  227. # amount of time defined in "long_query_time" or which do not use
  228. # indexes well, if log_short_format is not enabled. It is normally good idea
  229. # to have this turned on if you frequently add new queries to the
  230. # system.
  231. slow_query_log
  232.  
  233. # All queries taking more than this amount of time (in seconds) will be
  234. # trated as slow. Do not use "1" as a value here, as this will result in
  235. # even very fast queries being logged from time to time (as MariaDB
  236. # currently measures time with second accuracy only).
  237. long_query_time = 2
  238.  
  239. # The directory used by MySQL for storing temporary files. For example,
  240. # it is used to perform disk based large sorts, as well as for internal
  241. # and explicit temporary tables. It might be good to put it on a
  242. # swapfs/tmpfs filesystem, if you do not create very large temporary
  243. # files. Alternatively you can put it on dedicated disk. You can
  244. # specify multiple paths here by separating them by ";" - they will then
  245. # be used in a round-robin fashion.
  246. #tmpdir = /tmp
  247.  
  248. # *** Replication related settings
  249.  
  250. # Unique server identification number between 1 and 2^32-1. This value
  251. # is required for both master and slave hosts. It defaults to 1 if
  252. # "master-host" is not set, but will MariaDB will not function as a master
  253. # if it is omitted.
  254. server-id = 1
  255.  
  256. # Replication Slave (comment out master section to use this)
  257. #
  258. # To configure this host as a replication slave, you can choose between
  259. # two methods :
  260. #
  261. # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  262. # the syntax is:
  263. #
  264. # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
  265. # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
  266. #
  267. # where you replace <host>, <user>, <password> by quoted strings and
  268. # <port> by the master's port number (3306 by default).
  269. #
  270. # Example:
  271. #
  272. # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
  273. # MASTER_USER='joe', MASTER_PASSWORD='secret';
  274. #
  275. # OR
  276. #
  277. # 2) Set the variables below. However, in case you choose this method, then
  278. # start replication for the first time (even unsuccessfully, for example
  279. # if you mistyped the password in master-password and the slave fails to
  280. # connect), the slave will create a master.info file, and any later
  281. # changes in this file to the variable values below will be ignored and
  282. # overridden by the content of the master.info file, unless you shutdown
  283. # the slave server, delete master.info and restart the slaver server.
  284. # For that reason, you may want to leave the lines below untouched
  285. # (commented) and instead use CHANGE MASTER TO (see above)
  286. #
  287. # required unique id between 2 and 2^32 - 1
  288. # (and different from the master)
  289. # defaults to 2 if master-host is set
  290. # but will not function as a slave if omitted
  291. #server-id = 2
  292. #
  293. # The replication master for this slave - required
  294. #master-host = <hostname>
  295. #
  296. # The username the slave will use for authentication when connecting
  297. # to the master - required
  298. #master-user = <username>
  299. #
  300. # The password the slave will authenticate with when connecting to
  301. # the master - required
  302. #master-password = <password>
  303. #
  304. # The port the master is listening on.
  305. # optional - defaults to 3306
  306. #master-port = <port>
  307.  
  308. # Make the slave read-only. Only users with the SUPER privilege and the
  309. # replication slave thread will be able to modify data on it. You can
  310. # use this to ensure that no applications will accidently modify data on
  311. # the slave instead of the master
  312. #read_only
  313.  
  314.  
  315. #*** MyISAM Specific options
  316.  
  317.  
  318. # Size of the Key Buffer, used to cache index blocks for MyISAM tables.
  319. # Do not set it larger than 30% of your available memory, as some memory
  320. # is also required by the OS to cache rows. Even if you're not using
  321. # MyISAM tables, you should still set it to 8-64M as it will also be
  322. # used for internal temporary disk tables.
  323. key_buffer_size = 32M
  324.  
  325. # MyISAM uses special tree-like cache to make bulk inserts (that is,
  326. # INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA
  327. # INFILE) faster. This variable limits the size of the cache tree in
  328. # bytes per thread. Setting it to 0 will disable this optimisation. Do
  329. # not set it larger than "key_buffer_size" for optimal performance.
  330. # This buffer is allocated when a bulk insert is detected.
  331. bulk_insert_buffer_size = 64M
  332.  
  333. # This buffer is allocated when MariaDB needs to rebuild the index in
  334. # REPAIR, OPTIMIZE, ALTER table statements as well as in LOAD DATA INFILE
  335. # into an empty table. It is allocated per thread so be careful with
  336. # large settings.
  337. myisam_sort_buffer_size = 128M
  338.  
  339. # The maximum size of the temporary file MariaDB is allowed to use while
  340. # recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
  341. # If the file-size would be bigger than this, the index will be created
  342. # through the key cache (which is slower).
  343. myisam_max_sort_file_size = 10G
  344.  
  345. # If a table has more than one index, MyISAM can use more than one
  346. # thread to repair them by sorting in parallel. This makes sense if you
  347. # have multiple CPUs and plenty of memory.
  348. myisam_repair_threads = 1
  349.  
  350. # Automatically check and repair not properly closed MyISAM tables.
  351. myisam_recover
  352.  
  353. # *** INNODB Specific options ***
  354.  
  355. # Use this option if you have a MariaDB server with InnoDB support enabled
  356. # but you do not plan to use it. This will save memory and disk space
  357. # and speed up some things.
  358. #skip-innodb
  359.  
  360. # Additional memory pool that is used by InnoDB to store metadata
  361. # information. If InnoDB requires more memory for this purpose it will
  362. # start to allocate it from the OS. As this is fast enough on most
  363. # recent operating systems, you normally do not need to change this
  364. # value. SHOW INNODB STATUS will display the current amount used.
  365. innodb_additional_mem_pool_size = 16M
  366.  
  367. # InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
  368. # row data. The bigger you set this the less disk I/O is needed to
  369. # access data in tables. On a dedicated database server you may set this
  370. # parameter up to 80% of the machine physical memory size. Do not set it
  371. # too large, though, because competition of the physical memory may
  372. # cause paging in the operating system. Note that on 32bit systems you
  373. # might be limited to 2-3.5G of user level memory per process, so do not
  374. # set it too high.
  375. innodb_buffer_pool_size = 2G
  376.  
  377. # InnoDB stores data in one or more data files forming the tablespace.
  378. # If you have a single logical drive for your data, a single
  379. # autoextending file would be good enough. In other cases, a single file
  380. # per device is often a good choice. You can configure InnoDB to use raw
  381. # disk partitions as well - please refer to the manual for more info
  382. # about this.
  383. innodb_data_file_path = ibdata1:10M:autoextend
  384.  
  385. # Set this option if you would like the InnoDB tablespace files to be
  386. # stored in another location. By default this is the MariaDB datadir.
  387. #innodb_data_home_dir = <directory>
  388.  
  389. # Number of IO threads to use for async IO operations. This value is
  390. # hardcoded to 8 on Unix, but on Windows disk I/O may benefit from a
  391. # larger number.
  392. innodb_write_io_threads = 8
  393. innodb_read_io_threads = 8
  394.  
  395. # If you run into InnoDB tablespace corruption, setting this to a nonzero
  396. # value will likely help you to dump your tables. Start from value 1 and
  397. # increase it until you're able to dump the table successfully.
  398. #innodb_force_recovery=1
  399.  
  400. # Number of threads allowed inside the InnoDB kernel. The optimal value
  401. # depends highly on the application, hardware as well as the OS
  402. # scheduler properties. A too high value may lead to thread thrashing.
  403. innodb_thread_concurrency = 16
  404.  
  405. # If set to 1, InnoDB will flush (fsync) the transaction logs to the
  406. # disk at each commit, which offers full ACID behavior. If you are
  407. # willing to compromise this safety, and you are running small
  408. # transactions, you may set this to 0 or 2 to reduce disk I/O to the
  409. # logs. Value 0 means that the log is only written to the log file and
  410. # the log file flushed to disk approximately once per second. Value 2
  411. # means the log is written to the log file at each commit, but the log
  412. # file is only flushed to disk approximately once per second.
  413. innodb_flush_log_at_trx_commit = 1
  414.  
  415. # Speed up InnoDB shutdown. This will disable InnoDB to do a full purge
  416. # and insert buffer merge on shutdown. It may increase shutdown time a
  417. # lot, but InnoDB will have to do it on the next startup instead.
  418. #innodb_fast_shutdown
  419.  
  420. # The size of the buffer InnoDB uses for buffering log data. As soon as
  421. # it is full, InnoDB will have to flush it to disk. As it is flushed
  422. # once per second anyway, it does not make sense to have it very large
  423. # (even with long transactions).
  424. innodb_log_buffer_size = 8M
  425.  
  426. # Size of each log file in a log group. You should set the combined size
  427. # of log files to about 25%-100% of your buffer pool size to avoid
  428. # unneeded buffer pool flush activity on log file overwrite. However,
  429. # note that a larger logfile size will increase the time needed for the
  430. # recovery process.
  431. innodb_log_file_size = 256M
  432.  
  433. # Total number of files in the log group. A value of 2-3 is usually good
  434. # enough.
  435. innodb_log_files_in_group = 3
  436.  
  437. # Location of the InnoDB log files. Default is the MariaDB datadir. You
  438. # may wish to point it to a dedicated hard drive or a RAID1 volume for
  439. # improved performance
  440. #innodb_log_group_home_dir
  441.  
  442. # Maximum allowed percentage of dirty pages in the InnoDB buffer pool.
  443. # If it is reached, InnoDB will start flushing them out agressively to
  444. # not run out of clean pages at all. This is a soft limit, not
  445. # guaranteed to be held.
  446. innodb_max_dirty_pages_pct = 90
  447.  
  448. # The flush method InnoDB will use for Log. The tablespace always uses
  449. # doublewrite flush logic. The default value is "fdatasync", another
  450. # option is "O_DSYNC".
  451. #innodb_flush_method=O_DSYNC
  452.  
  453. # How long an InnoDB transaction should wait for a lock to be granted
  454. # before being rolled back. InnoDB automatically detects transaction
  455. # deadlocks in its own lock table and rolls back the transaction. If you
  456. # use the LOCK TABLES command, or other transaction-safe storage engines
  457. # than InnoDB in the same transaction, then a deadlock may arise which
  458. # InnoDB cannot notice. In cases like this the timeout is useful to
  459. # resolve the situation.
  460. innodb_lock_wait_timeout = 120
  461.  
  462.  
  463. [mysqldump]
  464. # Do not buffer the whole result set in memory before writing it to
  465. # file. Required for dumping very large tables
  466. quick
  467.  
  468. max_allowed_packet = 16M
  469.  
  470. [mysql]
  471. no-auto-rehash
  472.  
  473. # Only allow UPDATEs and DELETEs that use keys.
  474. #safe-updates
  475.  
  476. [myisamchk]
  477. key_buffer_size = 512M
  478. sort_buffer_size = 512M
  479. read_buffer = 8M
  480. write_buffer = 8M
  481.  
  482. [mysqlhotcopy]
  483. interactive-timeout
  484.  
  485. [mysqld_safe]
  486. # Increase the amount of open files allowed per process. Warning: Make
  487. # sure you have set the global system limit high enough! The high value
  488. # is required for a large number of opened tables
  489. open-files-limit = 8192
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement