Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Brief Analysis of parameters of mysql configuration File

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following content mainly brings you a brief analysis of the parameters of the mysql configuration file, the knowledge mentioned here, which is slightly different from books, is summed up by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing. I hope to bring help to the majority of readers.

Tonight, we are going to create more than a dozen mysql databases and post a mysql profile parameter for reference:

Cat / etc/my.cnf

[mysql]

# CLIENT #

Port = 3307

Socket = / data/mysql_3307/data/mysql.sock

Default-character-set = utf8

#

[mysqld]

#

Port = 3307

# GENERAL #

User = mysql

Default-storage-engine = InnoDB

Socket = / data/mysql_3307/data/mysql.sock

Pid-file = / data/mysql_3307/data/mysql.pid

Character_set_server = utf8

#

# MyISAM #

Key-buffer-size = 32m

Myisam-recover-options = FORCE,BACKUP

#

# SAFETY #

Max-connections = 100000

Max-allowed-packet = 256m

Max-connect-errors = 1000000

Skip-name-resolve

Sysdate-is-now = 1

Lower_case_table_names = 1

Explicit_defaults_for_timestamp = 1

Symbolic-links = 0

#

# DATA STORAGE #

Basedir = / usr/local/mysql

Datadir = / data/mysql_3307/data

#

# BINARY LOGGING #

Server-id = 56100

Log-bin = / data/mysql_3307/data/mysql-bin

Expire-logs-days = 14

Sync-binlog = 1

Log_bin_trust_function_creators = 1

Transaction_isolation = READ-COMMITTED

# GITD MODE #

Gtid_mode = ON

Enforce-gtid-consistency = 1

Binlog_cache_size = 4m

Max_binlog_size = 1G

Max_binlog_cache_size = 2G

#

# REPLICATION #

Skip-slave-start = 0

Relay-log = / data/mysql_3307/data/relay-bin

Slave-net-timeout = 60

Sync-master-info = 0

Sync-relay-log = 0

Sync-relay-log-info = 0

Slave_pending_jobs_size_max = 256m

Binlog_group_commit_sync_delay = 100000

#

# rpl_semi_sync_master_enabled=1

# rpl_semi_sync_master_timeout=10000# means 10 second

# rpl_semi_sync_slave_enabled=1

#

Slave-parallel-type = LOGICAL_CLOCK

Slave-parallel-workers = 24

Master_info_repository = TABLE

Relay_log_info_repository = TABLE

Relay_log_recovery = ON

# CACHES AND LIMITS #

Tmp-table-size = 32m

Max-heap-table-size = 32m

Query-cache-type = 0

Query-cache-size = 0

Thread-cache-size = 300

Open-files-limit = 65535

Table-definition-cache = 4096

Table-open-cache = 4096

#

# INNODB #

Innodb-flush-method = O_DIRECT

Innodb-log-files-in-group = 5

Innodb-log-file-size = 2048m

Innodb-flush-log-at-trx-commit = 1

Innodb-file-per-table = 1

Innodb-buffer-pool-size = 300g

Innodb_io_capacity = 10000

Innodb_io_capacity_max = 20000

Innodb_write_io_threads = 16

Innodb_read_io_threads = 16

Innodb_flush_neighbors = 0

Innodb_buffer_pool_instances = 16

Innodb_max_dirty_pages_pct = 75

# LOGGING #

Log-error = / logs/mysql_3307/mysql-error.log

Log_timestamps = SYSTEM

Log-queries-not-using-indexes = 0

Slow-query-log = 1

Slow-query-log-file = / logs/mysql_3307/mysql-slow.log

Long_query_time = 1

#

[mysqladmin]

Port = 3307

Socket = / data/mysql_3307/data/mysql.sock

[mysqldump]

Port = 3307

Socket = / data/mysql_3307/data/mysql.sock

#

[xtrabackup]

Port = 3307

Socket = / data/mysql_3307/data/mysql.sock

[mysqlbackup]

Port = 3307

Socket = / data/mysql_3307/data/mysql.sock

For the above brief analysis of the parameters of the mysql configuration file, if you need to know more, you can continue to pay attention to the innovation of our industry. If you need professional solutions, you can contact the pre-sale and after-sales on the official website. I hope this article can bring you some knowledge updates.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report