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 adjust the log group in MYSQL

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

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to adjust the log group in MYSQL, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

1. View the shutdown method:

Mysql > show variables like'% fast%'

+-+ +

| | Variable_name | Value |

+-+ +

| | innodb_fast_shutdown | 1 | |

+-+ +

1 row in set (0.00 sec)

This parameter is explained as follows: the default value is 1, and the setting of 0 is clean. The shutdown corresponds to the shutdown immeidate in ORACLE.

The InnoDB shutdown mode. If the value is 0, InnoDB does a slow shutdown, a full purge and a change buffer merge before shutting down. If the value is 1 (the default), InnoDB skips these operations at shutdown, a process known as a fast shutdown. If the value is 2, InnoDB flushes its logs and shuts down cold, as if MySQL had crashed; no committed transactions are lost, but the crash recovery operation makes the next startup take longer. .

2. Adjust the parameter innodb_fast_shutdown to 0

Set global innodb_fast_shutdown=0

3. Close MYSQL

Mysqladmin-uroot shutdown-S / home/mysql-5.6/mysql-3306/mysql.sock

4. Resize REDO. Log files are named at the beginning of ib_logfile by default.

1. Find the directory where the REDO file is located (several files are processed, move to another directory).

Mv ib_logfilexx.. / ib_logfilexx

2. Add parameters: number of log groups and log size to parameter file

Add the following parameters under the parameter file [mysqld]

Innodb_log_file_size = 512m-size of each log group 512m

Innodb_log_files_in_group = 3-A total of 3 log groups

5. Open mysql

. / mysqld_safe-- defaults-file=/home/mysql-5.6/mysql-3307/my.cnf &

6. View the size and number of modified log groups

Mysql > show variables like'% log_file%'

+-+

| | Variable_name | Value |

+-+

| | general_log_file | / home/mysql-5.6/mysql-3306/data/test1.log |

| | innodb_log_file_size | 536870912 | |

| | innodb_log_files_in_group | 3 | |

| | slow_query_log_file | / home/mysql-5.6/mysql-3306/data/test1-slow.log |

+-+

4 rows in set (0.00 sec)

The above is how to adjust the log group in MYSQL. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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

Wechat

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

12
Report