Linux MySQL 4G memory my. cnf configuration table

Source: Internet
Author: User
Tags pkill

# The following options will be passed to all MySQL clients
[Client]
Character-set-server = utf8 ##### Default Client Connection word set. This parameter is not required if it is specified during compilation and installation.
Port = 3306 ### client connection communication port
Socket =/tmp/mysql. sock # Save the file for information such as the user password port for client communication

# Here follows entries for some specific programs

# The MySQL server
[Mysqld]
Port = 3306 # mysql server listening port

Basedir =/usr/local/mysql ### Mysql software directory
Datadir =/usr/local/mysql/var ### mysql database storage directory
Socket =/tmp/mysql. sock # server communication file. If it is lost, restart Mysql to generate it again. If the restart fails, it may be because the mysqld process has not been killed. After pkill mysql is used, Mysql can be restarted successfully.
Pid-file =/usr/local/mysql/var/mysql. pid ## server pid process file. If the file is lost, restart Mysql to generate the file again. If the restart fails, it may be because the mysqld process is not killed. After pkill mysql is used, Mysql can be restarted successfully.
Skip-external-locking ### prevent external lock on the table
Skip-name-resolve ### disable DNS resolution of Mysqlr. You can only use an IP address to connect to the database.
Key_buffer_size = 384 M ### Cache Optimization for Myisam Table engine only
Max_allowed_packet = 32 M ### memory used by the maximum client query table
Table_open_cache = 1024 ### maximum number of cache tables on the server
Sort_buffer_size = 2 M # maximum sorting memory for each connection
Join_buffer_size = 1 M # maximum memory for each join query statement
Net_buffer_length = 1 M
Read_buffer_size = 2 M
Read_rnd_buffer_size = 16 M
Myisam_sort_buffer_size = 128 M
Thread _ cache_size = 300
Query_cache_size = 256 M
Query_cache_limit = 2 M
Thread_concurrency = 4 ## CPU * 2
Wait_timeout = 120 ### maximum SQL statement execution time
Max_connections = 5000 ### maximum number of connections allowed to the database
Max_connect_errors = 6000 # Number of database connection errors allowed by the client to prevent brute-force password cracking

Character-set-server = utf8 # default server and database character set
Collation-server = utf8_general_ci ### client-side correction Character Set
Log_slow_queries = slowquery. log # Slow query log file
Long_query_time = 3 ### slow query time
Myisam_recover ### mysql restarts to automatically repair the MYisam table
Replicate-ignore-db = mysql ### name of the database that does not need to be synchronized during data synchronization
Replicate-ignore-db = information_schema
Bind-address = 121.14.145.96 # It is important to write multiple IP addresses on the server.


# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# If all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (Via the "enable-named-pipe" option) will render mysqld useless!
#
# Skip-networking

# Replication Master Server (default)
# Binary logging is required for replication
Log-bin = mysql-bin

# Binary logging format-mixed recommended
Binlog_format = mixed

# Required unique id between 1 and 2 ^ 32-1
# Defaults to 1 if master-host is not set
# But will not function as a master if omitted
Server-id = 1

# Uncomment the following if you are using InnoDB tables
# Innodb_data_home_dir =/usr/local/mysql/var
# Innodb_data_file_path = ibdata1: 10 M: autoextend
# Innodb_log_group_home_dir =/usr/local/mysql/var
# You can set .. _ buffer_pool_size up to 50-80%
# Of RAM but beware of setting memory usage too high
# Innodb_buffer_pool_size = 16 M
# Innodb_additional_mem_pool_size = 2 M
# Set .. _ log_file_size to 25% of buffer pool size
# Innodb_log_file_size = 5 M
# Innodb_log_buffer_size = 8 M
# Innodb_flush_log_at_trx_commit = 1
# Innodb_lock_wait_timeout = 50

[Mysqldump]
Quick
Max_allowed_packet = 32 M

[Mysql]
No-auto-rehash
# Remove the next comment character if you are not familiar with SQL
# Safe-updates

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

[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.