MARIADB (Mysql Branch) my.cnf configuration file Chinese annotation version _mysql

Source: Internet
Author: User
Tags memory usage mixed unique id

Copy Code code as follows:

#/USR/SHARE/MYSQL/MY-HUGE.CNF
# mariadb configuration File Sample template (huge, mega).
#
# This file applies to the dedicated database server, memory for 1G-2G
# The large system on the machine that mainly runs only mariadb,
#
# The MARIADB program will look up a series of profiles based on the operating system platform.
# You can copy this template profile to the appropriate location (and rename it).
# to see which configuration files are read, execute:
# ' My_print_defaults--help ' and view
# Default options are read from the following files in the given order:
# (The--> program reads the listed configuration files sequentially.) The list of files (paths) listed below this section.
# For more information please refer to: http://dev.mysql.com/doc/mysql/en/option-files.html
#
# in each section of this document, you can use all the options supported by the program.
# If you want to know whether a program supports a parameter,
# You can use the "--help" option to start the program to view help information.

# The configuration options in the following section are read by all local MySQL clients, as the default configuration
[Client]
#password = Your_password
Port = 3306
Socket =/var/lib/mysql/mysql.sock

# The following sections, which are read by various applications to parse

# MySQL Server configuration information
[Mysqld]
Port = 3306
Socket =/var/lib/mysql/mysql.sock
Skip-external-locking
Key_buffer_size = 384M
Max_allowed_packet = 1M
Table_open_cache = 512
Sort_buffer_size = 2M
Read_buffer_size = 2M
Read_rnd_buffer_size = 8M
Myisam_sort_buffer_size = 64M
Thread_cache_size = 8
Query_cache_size = 32M
# Number of concurrent threads, it is recommended to multiply the CPU core by 2:cpu ' s*2 for thread_concurrency
Thread_concurrency = 8

# you can specify a path to a dedicated disk as a temporary directory, such as SSD
#tmpdir =/tmp/

# Configuring this parameter does not initiate TCP/IP port monitoring.
# If all the handlers are connected to mysqld on the same machine, this is a very safe approach,
# All interactions with mysqld can only be done through UNIX sockets or named pipes (named pipes).
# Note that using this option does not open the named pipe on Windows (Named pipes),
# (through "enable-named-pipe" configuration items) will cause Mysqld to be unavailable!
#skip-networking

# Master server configuration Option Replication master server (default)
# in the master-slave replication, the need to rely on binary log
Log-bin=mysql-bin

# in the entire master-slave replication cluster requires a unique ID between 1 and 2^32-1, or failure, or a large number of error log information.
# If Master-host is not set, the default value is 1
# but if omitted, then (master) does not take effect
Server-id = 1

# Replication Slave from the server configuration option (you need to comment out the master section to use this section)
#
# To configure the server as a secondary server (replication slave),
# There are two options available:
#
# 1 through the Change MASTER to command (detailed description in the user manual)-
# The syntax is as follows:
#
# change MASTER to Master_host=# master_user=<user>, master_password=<password>;
#
# you can # Replace <port> with the port number of master (default is 3306).
#
# An example is shown below:
#
# change MASTER to master_host= ' 125.564.12.1 ', master_port=3306,
# master_user= ' Joe ', master_password= ' secret ';
#
Or
#
# 2) Set the following parameters. However, once you have chosen this way,
# when you first start master-slave replication (even if you start a replication failure, such as an incorrect Master-password password,
# causes the slave connection to be slave, a file named Master.info will be created.
# If you later modify these parameters in this configuration file (XXX.CNF), it will be ignored.
# and continue to use the contents of the Master.info file,
# unless you close the slave server, then delete the file Master.info and restart Slaver server.
# for this reason, you should not modify the following parameter parameters (with <> annotation section).
# instead of using change MASTER to (scenario 1 above)
#
#
# a unique ID between 2 and 2^32-1 is required in the entire master-slave replication cluster.
# Otherwise or failed, or a lot of error log information.
# if Master-host is set, the default value is 2
# but if omitted, it will not become slave
#server-id = 2
#
# This slave needs to connect to master. -Required
#master-host = #
# slave required to connect to master authentication username
#-User name is required (or can be specified on connection)
#master-user = <username>
#
# slave required to connect to master authentication password
#-passwords are required (or can be specified at connection time)
#master-password = <password>
#
# Master Listener's port number
# optional-Default is 3306
#master-port = <port>
#
# Open binary log, for slave from server is not required, but recommended to open
#log-bin=mysql-bin
#
# binary log format--Recommended mixed
#binlog_format =mixed

# If you are using only InnoDB tables, uncomment the following options
#innodb_data_home_dir =/var/lib/mysql
#innodb_data_file_path = Ibdata1:2000m;ibdata2:10m:autoextend
#innodb_log_group_home_dir =/var/lib/mysql
# If you are using only InnoDB, you can set ... _buffer_pool_size is 50-80 of physical memory
# Beware of memory usage setting too high
#innodb_buffer_pool_size = 384M
# Additional Cache Pool Size
#innodb_additional_mem_pool_size = 20M
# set ... _log_file_size is about 25 of the buffer pool size
#innodb_log_file_size = 100M
# The size of the log cache, do not set too large, 1 seconds to refresh once
#innodb_log_buffer_size = 8M
# default 1, transaction commit will refresh log to hard disk;
# set to 2, flush to the operating system cache, but performance is much improved, set to 0 may lose transactions.
#innodb_flush_log_at_trx_commit = 1
# table Deadlock Timeout release time, in seconds
#innodb_lock_wait_timeout = 50

[Mysqldump]
# Fast export to output stream/hard drive, not cached in memory
Quick
# Maximum Packet limit
Max_allowed_packet = 16M

[MySQL]
No-auto-rehash
# If you are unfamiliar with SQL, you can remove the following annotation characters and reject unsafe operations without a where.
#safe-updates

[Myisamchk]
Key_buffer_size = 256M
Sort_buffer_size = 256M
Read_buffer = 2M
Write_buffer = 2M

[Mysqlhotcopy]
Interactive-timeout


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.