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

How to install MySQL 5.7 on CentOS 7.3

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

Share

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

mysql 5.7 automatic installation based on centos 7, here by the way, some defined parameters in my.cnf, such as the following two innodb_buffer_dump_at_shutdown=1 #dump hot data to local disk innodb_buffer_pool_load_at_startup=1 #load hot data into memory at startup because mysql will face a problem when restarting, that is, how to reload the frequently accessed data back into Buffer. That is, how to warm up the InnoDB Buffer Pool to quickly restore the previous performance state. Add the custom directory of undo log, because if you split undo log from the shared table space ibdata1, you need to specify it in my.cnf in advance, otherwise you will report an error after the database is started. innodb_undo_log_truncate=1 #Enable online recycling innodb_max_undo_los_size=1G #This is the threshold (default is 1GB), will trigger the truncate recycling action. Then say, the following configuration innodb_temp_data_file_path = ibtmp1:12M:autoextend:max:5G Because ibtmp1 file is a new feature of MySQL 5.7, MySQL 5.7 uses a separate temporary table space to store temporary table data, initialized to 12M, and the default has no upper limit, I set the maximum here can not exceed 5g, the only way to free this temporary table space is to open the database. innodb_read_io_threads, innodb_write_io_threads: The number of I/O threads for file reading and writing can be adjusted appropriately according to the concurrency and the number of CPU cores. Don't tangle the query_cache_size and query_cache_type parameters again. This is useless for mysql and is turned off by default. It is recommended to use the default value, that is, set to 0. Close Redo logs records all data changes Recovery time is no longer a problem innodb_log_file_size = 2047M before 5.6innodb_log_file_size>= 2047M from 5.6 So... The larger the system performance is more stable. You should all know innodb_buffer_pool_size. You know, 50~70% of your physical memory size. Finally, the new version of mysql listens by default on IPv6. Remember to turn it off. Bind-address=0.0.0.0 When a deadlock occurs in mysql database, innodb status will record the information about the last deadlock, but mysql error log will not record deadlock related information. If you want to record, Start the innodb_print_all_deadlocks parameter. When the system concurrency is very high, many threads are waiting for the same row lock, deadlock detection may slow down the system, at this time it may be better to turn off deadlock detection innodb_print_all_deadlocks = 1 Finally, MySQL default isolation level is not suitable for most application scenarios, and deadlocks are prone to occur, so I changed it to read-committed here. Finally, the installation steps are already scripted. mkdir -p /home/toolscd /home/toolsyum -y install numactl libaiowget http://god.nongdingbang.net/downloads/mysql-5.7-el7.tgz && tar zxvf mysql-5.7-el7.tgzif [ $? -eq 0 ];thenrpm -Uvh mysql*.rpmfimkdir -p /data/{mysql_data,mysql_log,mysql_slow,mysql_undo}chown -R mysql.mysql /data/*cat >/etc/my.cnf

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