mysql innodb ibdata ib_logfile_MySQL中ib_logfile和ibdata1参数大小被修改后_MySQL

2023-10-22 19:10

本文主要是介绍mysql innodb ibdata ib_logfile_MySQL中ib_logfile和ibdata1参数大小被修改后_MySQL,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1. 环境说明

RHEL 6.4 x86_64 + MySQL 5.5.37和MySQL 5.6.19

blog地址:http://blog.csdn.net/hw_libo/article/details/39215723

2. 案例:redo log文件(ib_logfile)大小参数被修改:innodb_log_file_size

innodb_log_file_size = 256M -- 修改为200M

版本是5.5的,启动失败,会出现如下错误:

InnoDB: Error: log file ./ib_logfile0 is of different size 0 268435456 bytes ## 原来redo log的大小

InnoDB: than specified in the .cnf file 0 209715200 bytes! ## redo log被修改的大小

140912 0:01:12 [ERROR] Plugin 'InnoDB' init function returned error.

140912 0:01:12 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

140912 0:01:12 [ERROR] Unknown/unsupported storage engine: InnoDB

140912 0:01:12 [ERROR] Aborting

版本是5.6.16之后的,正常启动,会自动将原来的redo log删除,然后重新生成新的redo log(这个比较重要):

2014-09-11 21:57:05 1093 [Warning] InnoDB: Resizing redo log from 2*16384 to 2*12800 pages, LSN=71249171

2014-09-11 21:57:05 1093 [Warning] InnoDB: Starting to delete and rewrite log files. ## 删除原redo log

2014-09-11 21:57:05 1093 [Note] InnoDB: Setting log file ./ib_logfile101 size to 200 MB

InnoDB: Progress in MB: 100 200

2014-09-11 21:57:06 1093 [Note] InnoDB: Setting log file ./ib_logfile1 size to 200 MB

InnoDB: Progress in MB: 100 200

2014-09-11 21:57:07 1093 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2014-09-11 21:57:07 1093 [Warning] InnoDB: New log files created, LSN=71249171 ## 新redo log重建完毕

原redo log大小:2*16384*8(page的大小为8k)/1024=256MB

新redo log大小:2*12800*8/1024=200MB

3. 案例:ibdata1文件大小参数被修改:innodb_data_file_path

(1)ibdata1从大改小

innodb_data_file_path = ibdata1:1G:autoextend -- 修改为:ibdata1:300M:autoextend

在版本是5.5和5.6中,启动正常,并且日志中没有任何异常。但是如果将autoextend去掉,就会报错,启动失败,如:[版本:5.5.37]

InnoDB: Error: data file ./ibdata1 is of a different size

InnoDB: 65536 pages (rounded down to MB)

InnoDB: than specified in the .cnf file 19200 pages!

140911 23:51:53 InnoDB: Could not open or create data files.

140911 23:51:53 InnoDB: If you tried to add new data files, and it failed here,

140911 23:51:53 InnoDB: you should now edit innodb_data_file_path in my.cnf back

140911 23:51:53 InnoDB: to what it was, and remove the new ibdata files InnoDB created

140911 23:51:53 InnoDB: in this failed attempt. InnoDB only wrote those files full of

140911 23:51:53 InnoDB: zeros, but did not yet use them in any way. But be careful: do not

140911 23:51:53 InnoDB: remove old data files which contain your precious data!

140911 23:51:53 [ERROR] Plugin 'InnoDB' init function returned error.

140911 23:51:53 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

140911 23:51:53 [ERROR] Unknown/unsupported storage engine: InnoDB

140911 23:51:53 [ERROR] Aborting

原来的ibdata1大小为:65536*8*2/1024=1024M=1G

当前ibdata1被修改为:19200*8*2/1024=300M

(2)ibdata1值小改大

比如:

innodb_data_file_path = ibdata1:1G:autoextend -- 修改为:ibdata1:1200M:autoextend

那么会在启动时出现如下错误:

*****在5.5版本中:[版本:5.5.37]

InnoDB: Error: auto-extending data file ./ibdata1 is of a different size

InnoDB: 65536 pages (rounded down to MB) than specified in the .cnf file:

InnoDB: initial 76800 pages, max 0 (relevant if non-zero) pages!

140911 23:57:43 InnoDB: Could not open or create data files.

140911 23:57:43 InnoDB: If you tried to add new data files, and it failed here,

140911 23:57:43 InnoDB: you should now edit innodb_data_file_path in my.cnf back

140911 23:57:43 InnoDB: to what it was, and remove the new ibdata files InnoDB created

140911 23:57:43 InnoDB: in this failed attempt. InnoDB only wrote those files full of

140911 23:57:43 InnoDB: zeros, but did not yet use them in any way. But be careful: do not

140911 23:57:43 InnoDB: remove old data files which contain your precious data!

140911 23:57:43 [ERROR] Plugin 'InnoDB' init function returned error.

140911 23:57:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

140911 23:57:43 [ERROR] Unknown/unsupported storage engine: InnoDB

140911 23:57:43 [ERROR] Aborting

*****在5.6版本中:[版本:5.6.19]

2014-09-11 22:20:01 1222 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 65536 pages (rounded down to MB) than

specified in the .cnf file: initial 76800 pages, max 0 (relevant if non-zero) pages!

2014-09-11 22:20:01 1222 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the syste

m tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata fil

es InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be caref

ul: do not remove old data files which contain your precious data!

2014-09-11 22:20:01 1222 [ERROR] Plugin 'InnoDB' init function returned error.

2014-09-11 22:20:01 1222 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2014-09-11 22:20:01 1222 [ERROR] Unknown/unsupported storage engine: InnoDB

2014-09-11 22:20:01 1222 [ERROR] Aborting

原来的ibdata1大小为:65536*8*2/1024=1024M=1G

当前ibdata1被修改为:76800*8*2/1024=1200M

blog地址:http://blog.csdn.net/hw_libo/article/details/39215723

-- Bosco QQ:375612082

---- END ----

-------------------------------------------------------------------------------------------------------

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

f68f2add0b68e4f9810432fce46917b7.png

相关标签:大小 参数

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

这篇关于mysql innodb ibdata ib_logfile_MySQL中ib_logfile和ibdata1参数大小被修改后_MySQL的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/263098

相关文章

MySQL 8 中的一个强大功能 JSON_TABLE示例详解

《MySQL8中的一个强大功能JSON_TABLE示例详解》JSON_TABLE是MySQL8中引入的一个强大功能,它允许用户将JSON数据转换为关系表格式,从而可以更方便地在SQL查询中处理J... 目录基本语法示例示例查询解释应用场景不适用场景1. ‌jsON 数据结构过于复杂或动态变化‌2. ‌性能要

MySQL字符串常用函数详解

《MySQL字符串常用函数详解》本文给大家介绍MySQL字符串常用函数,本文结合实例代码给大家介绍的非常详细,对大家学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录mysql字符串常用函数一、获取二、大小写转换三、拼接四、截取五、比较、反转、替换六、去空白、填充MySQL字符串常用函数一、

MySQL中比较运算符的具体使用

《MySQL中比较运算符的具体使用》本文介绍了SQL中常用的符号类型和非符号类型运算符,符号类型运算符包括等于(=)、安全等于(=)、不等于(/!=)、大小比较(,=,,=)等,感兴趣的可以了解一下... 目录符号类型运算符1. 等于运算符=2. 安全等于运算符<=>3. 不等于运算符<>或!=4. 小于运

虚拟机Centos7安装MySQL数据库实践

《虚拟机Centos7安装MySQL数据库实践》用户分享在虚拟机安装MySQL的全过程及常见问题解决方案,包括处理GPG密钥、修改密码策略、配置远程访问权限及防火墙设置,最终通过关闭防火墙和停止Net... 目录安装mysql数据库下载wget命令下载MySQL安装包安装MySQL安装MySQL服务安装完成

MySQL进行数据库审计的详细步骤和示例代码

《MySQL进行数据库审计的详细步骤和示例代码》数据库审计通过触发器、内置功能及第三方工具记录和监控数据库活动,确保安全、完整与合规,Java代码实现自动化日志记录,整合分析系统提升监控效率,本文给大... 目录一、数据库审计的基本概念二、使用触发器进行数据库审计1. 创建审计表2. 创建触发器三、Java

MySQL逻辑删除与唯一索引冲突解决方案

《MySQL逻辑删除与唯一索引冲突解决方案》本文探讨MySQL逻辑删除与唯一索引冲突问题,提出四种解决方案:复合索引+时间戳、修改唯一字段、历史表、业务层校验,推荐方案1和方案3,适用于不同场景,感兴... 目录问题背景问题复现解决方案解决方案1.复合唯一索引 + 时间戳删除字段解决方案2:删除后修改唯一字

Zabbix在MySQL性能监控方面的运用及最佳实践记录

《Zabbix在MySQL性能监控方面的运用及最佳实践记录》Zabbix通过自定义脚本和内置模板监控MySQL核心指标(连接、查询、资源、复制),支持自动发现多实例及告警通知,结合可视化仪表盘,可有效... 目录一、核心监控指标及配置1. 关键监控指标示例2. 配置方法二、自动发现与多实例管理1. 实践步骤

MySQL 主从复制部署及验证(示例详解)

《MySQL主从复制部署及验证(示例详解)》本文介绍MySQL主从复制部署步骤及学校管理数据库创建脚本,包含表结构设计、示例数据插入和查询语句,用于验证主从同步功能,感兴趣的朋友一起看看吧... 目录mysql 主从复制部署指南部署步骤1.环境准备2. 主服务器配置3. 创建复制用户4. 获取主服务器状态5

SpringBoot中六种批量更新Mysql的方式效率对比分析

《SpringBoot中六种批量更新Mysql的方式效率对比分析》文章比较了MySQL大数据量批量更新的多种方法,指出REPLACEINTO和ONDUPLICATEKEY效率最高但存在数据风险,MyB... 目录效率比较测试结构数据库初始化测试数据批量修改方案第一种 for第二种 case when第三种

MySql基本查询之表的增删查改+聚合函数案例详解

《MySql基本查询之表的增删查改+聚合函数案例详解》本文详解SQL的CURD操作INSERT用于数据插入(单行/多行及冲突处理),SELECT实现数据检索(列选择、条件过滤、排序分页),UPDATE... 目录一、Create1.1 单行数据 + 全列插入1.2 多行数据 + 指定列插入1.3 插入否则更