Guest User

MySQL my.cnf

a guest
May 29th, 2014
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.55 KB | None | 0 0
  1. # Example MariaDB config file for medium systems.
  2. #
  3. # This is for a system with little memory (32M - 64M) where MariaDB plays
  4. # an important part, or systems up to 128M where MariaDB is used together with
  5. # other programs (such as a web server)
  6. #
  7. # MariaDB programs look for option files in a set of
  8. # locations which depend on the deployment platform.
  9. # You can copy this option file to one of those
  10. # locations. For information about these locations, do:
  11. # 'my_print_defaults --help' and see what is printed under
  12. # Default options are read from the following files in the given order:
  13. # More information at: http://dev.mysql.com/doc/mysql/en/option-files.html
  14. #
  15. # In this file, you can use all long options that a program supports.
  16. # If you want to know which options a program supports, run the program
  17. # with the "--help" option.
  18.  
  19. # The following options will be passed to all MariaDB clients
  20. [client]
  21. #password = your_password
  22. port = 3306
  23. socket = /var/run/mysql/mysql.sock
  24.  
  25. # Here follows entries for some specific programs
  26.  
  27. # The MariaDB server
  28. [mysqld]
  29. port = 3306
  30. socket = /var/run/mysql/mysql.sock
  31. # Change following line if you want to store your database elsewhere
  32. datadir = /var/lib/mysql
  33. skip-external-locking
  34. key_buffer_size = 16M
  35. max_allowed_packet = 2M
  36. table_open_cache = 64
  37. sort_buffer_size = 512K
  38. net_buffer_length = 8K
  39. read_buffer_size = 256K
  40. read_rnd_buffer_size = 512K
  41. myisam_sort_buffer_size = 8M
  42.  
  43. max_connections = 900
  44.  
  45. # Point the following paths to different dedicated disks
  46. #tmpdir = /tmp/
  47.  
  48. # Don't listen on a TCP/IP port at all. This can be a security enhancement,
  49. # if all processes that need to connect to mysqld run on the same host.
  50. # All interaction with mysqld must be made via Unix sockets or named pipes.
  51. # Note that using this option without enabling named pipes on Windows
  52. # (via the "enable-named-pipe" option) will render mysqld useless!
  53. #
  54. #skip-networking
  55.  
  56. # Replication Master Server (default)
  57. # binary logging is required for replication
  58. # log-bin=mysql-bin
  59.  
  60. # binary logging format - mixed recommended
  61. # binlog_format=mixed
  62.  
  63. # required unique id between 1 and 2^32 - 1
  64. # defaults to 1 if master-host is not set
  65. # but will not function as a master if omitted
  66. server-id = 1
  67.  
  68. # Replication Slave (comment out master section to use this)
  69. #
  70. # To configure this host as a replication slave, you can choose between
  71. # two methods :
  72. #
  73. # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
  74. # the syntax is:
  75. #
  76. # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
  77. # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
  78. #
  79. # where you replace <host>, <user>, <password> by quoted strings and
  80. # <port> by the master's port number (3306 by default).
  81. #
  82. # Example:
  83. #
  84. # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
  85. # MASTER_USER='joe', MASTER_PASSWORD='secret';
  86. #
  87. # OR
  88. #
  89. # 2) Set the variables below. However, in case you choose this method, then
  90. # start replication for the first time (even unsuccessfully, for example
  91. # if you mistyped the password in master-password and the slave fails to
  92. # connect), the slave will create a master.info file, and any later
  93. # change in this file to the variables' values below will be ignored and
  94. # overridden by the content of the master.info file, unless you shutdown
  95. # the slave server, delete master.info and restart the slaver server.
  96. # For that reason, you may want to leave the lines below untouched
  97. # (commented) and instead use CHANGE MASTER TO (see above)
  98. #
  99. # required unique id between 2 and 2^32 - 1
  100. # (and different from the master)
  101. # defaults to 2 if master-host is set
  102. # but will not function as a slave if omitted
  103. #server-id = 2
  104. #
  105. # The replication master for this slave - required
  106. #master-host = <hostname>
  107. #
  108. # The username the slave will use for authentication when connecting
  109. # to the master - required
  110. #master-user = <username>
  111. #
  112. # The password the slave will authenticate with when connecting to
  113. # the master - required
  114. #master-password = <password>
  115. #
  116. # The port the master is listening on.
  117. # optional - defaults to 3306
  118. #master-port = <port>
  119. #
  120. # binary logging - not required for slaves, but recommended
  121. #log-bin=mysql-bin
  122.  
  123. # Uncomment the following if you are using InnoDB tables
  124. #innodb_data_home_dir = /var/lib/mysql
  125. #innodb_data_file_path = ibdata1:10M:autoextend
  126. #innodb_log_group_home_dir = /var/lib/mysql
  127. # You can set .._buffer_pool_size up to 50 - 80 %
  128. # of RAM but beware of setting memory usage too high
  129. #innodb_buffer_pool_size = 16M
  130. #innodb_additional_mem_pool_size = 2M
  131. # Set .._log_file_size to 25 % of buffer pool size
  132. #innodb_log_file_size = 5M
  133. #innodb_log_buffer_size = 8M
  134. #innodb_flush_log_at_trx_commit = 1
  135. #innodb_lock_wait_timeout = 50
  136.  
  137. # The safe_mysqld script
  138. [safe_mysqld]
  139. log-error = /var/log/mysql/mysqld.log
  140. socket = /var/run/mysql/mysql.sock
  141.  
  142. !includedir /etc/mysql
  143.  
  144. [mysqldump]
  145. socket = /var/run/mysql/mysql.sock
  146. quick
  147. max_allowed_packet = 16M
  148.  
  149. [mysql]
  150. no-auto-rehash
  151. # Remove the next comment character if you are not familiar with SQL
  152. #safe-updates
  153.  
  154. [myisamchk]
  155. key_buffer_size = 20M
  156. sort_buffer_size = 20M
  157. read_buffer = 2M
  158. write_buffer = 2M
  159.  
  160. [mysqlhotcopy]
  161. interactive-timeout
  162.  
  163. [mysqld_multi]
  164. mysqld = /usr/bin/mysqld_safe
  165. mysqladmin = /usr/bin/mysqladmin
  166. log = /var/log/mysqld_multi.log
  167. # user = multi_admin
  168. # password = secret
  169.  
  170. # If you want to use mysqld_multi uncomment 1 or more mysqld sections
  171. # below or add your own ones.
  172.  
  173. # WARNING
  174. # --------
  175. # If you uncomment mysqld1 than make absolutely sure, that database mysql,
  176. # configured above, is not started. This may result in corrupted data!
  177. # [mysqld1]
  178. # port = 3306
  179. # datadir = /var/lib/mysql
  180. # pid-file = /var/lib/mysql/mysqld.pid
  181. # socket = /var/lib/mysql/mysql.sock
  182. # user = mysql
  183.  
  184. # [mysqld2]
  185. # port = 3307
  186. # datadir = /var/lib/mysql-databases/mysqld2
  187. # pid-file = /var/lib/mysql-databases/mysqld2/mysql.pid
  188. # socket = /var/lib/mysql-databases/mysqld2/mysql.sock
  189. # user = mysql
  190.  
  191. # [mysqld3]
  192. # port = 3308
  193. # datadir = /var/lib/mysql-databases/mysqld3
  194. # pid-file = /var/lib/mysql-databases/mysqld3/mysql.pid
  195. # socket = /var/lib/mysql-databases/mysqld3/mysql.sock
  196. # user = mysql
  197.  
  198. # [mysqld6]
  199. # port = 3309
  200. # datadir = /var/lib/mysql-databases/mysqld6
  201. # pid-file = /var/lib/mysql-databases/mysqld6/mysql.pid
  202. # socket = /var/lib/mysql-databases/mysqld6/mysql.sock
  203. # user = mysql
  204.  
  205. innodb_file_per_table = 1
Advertisement
Add Comment
Please, Sign In to add comment