MySQL5.6如何修改REDO日志的大小和个数
这篇文章给大家分享的是有关MySQL 5.6如何修改REDO日志的大小和个数的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
创新互联建站专注为客户提供全方位的互联网综合服务,包含不限于成都做网站、网站建设、矿区网络推广、小程序开发、矿区网络营销、矿区企业策划、矿区品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联建站为所有大学生创业者提供矿区建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com
一套线上环境的REDO日志的大小和格式设置的不合理,需要将日志大小修改成2G,个数改为5个。
# 修改参数文件
# vi /etc/my_56.cnf
innodb_log_file_size = 2G
innodb_log_files_in_group = 5
# 重启数据库
# 启动的时候,查看错误日志,可以看到重新初始化了REDO日志
2018-05-28 09:40:54 25439 [Note] Plugin 'FEDERATED' is disabled.
2018-05-28 09:40:54 25439 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-05-28 09:40:54 25439 [Note] InnoDB: The InnoDB memory heap is disabled
2018-05-28 09:40:54 25439 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-05-28 09:40:54 25439 [Note] InnoDB: Memory barrier is not used
2018-05-28 09:40:54 25439 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-05-28 09:40:54 25439 [Note] InnoDB: Using Linux native AIO
2018-05-28 09:40:54 25439 [Note] InnoDB: Using CPU crc32 instructions
2018-05-28 09:40:54 25439 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2018-05-28 09:40:55 25439 [Note] InnoDB: Completed initialization of buffer pool
2018-05-28 09:40:55 25439 [Note] InnoDB: Highest supported file format is Barracuda.
2018-05-28 09:40:55 25439 [Warning] InnoDB: Resizing redo log from 2*3072 to 5*131072 pages, LSN=19620839567
2018-05-28 09:40:55 25439 [Warning] InnoDB: Starting to delete and rewrite log files.
2018-05-28 09:40:55 25439 [Note] InnoDB: Setting log file ./ib_logfile101 size to 2048 MB
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000
2018-05-28 09:41:06 25439 [Note] InnoDB: Setting log file ./ib_logfile1 size to 2048 MB
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000
2018-05-28 09:41:16 25439 [Note] InnoDB: Setting log file ./ib_logfile2 size to 2048 MB
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000
2018-05-28 09:41:26 25439 [Note] InnoDB: Setting log file ./ib_logfile3 size to 2048 MB
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000
2018-05-28 09:41:36 25439 [Note] InnoDB: Setting log file ./ib_logfile4 size to 2048 MB
InnoDB: Progress in MB: 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000
2018-05-28 09:41:46 25439 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2018-05-28 09:41:46 25439 [Warning] InnoDB: New log files created, LSN=19620839567
2018-05-28 09:41:46 25439 [Note] InnoDB: 128 rollback segment(s) are active.
2018-05-28 09:41:46 25439 [Note] InnoDB: Waiting for purge to start
2018-05-28 09:41:46 25439 [Note] InnoDB: 5.6.39 started; log sequence number 19620839567
2018-05-28 09:41:46 25439 [Note] Server hostname (bind-address): '*'; port: 3306
2018-05-28 09:41:46 25439 [Note] IPv6 is available.
# 启动成功后,查看REDO日志的大小
mysql> show global variables like '%innodb_log_file_size%';
+----------------------+------------+
| Variable_name | Value |
+----------------------+------------+
| innodb_log_file_size | 2147483648 |
+----------------------+------------+
1 row in set (0.01 sec)
mysql> show global variables like '%innodb_log_files_in_group%';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| innodb_log_files_in_group | 5 |
+---------------------------+-------+
1 row in set (0.01 sec)
感谢各位的阅读!关于“MySQL 5.6如何修改REDO日志的大小和个数”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
标题名称:MySQL5.6如何修改REDO日志的大小和个数
本文链接:http://azwzsj.com/article/piogij.html