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进阶之路索引失效的11种情况详析

《MySQL进阶之路索引失效的11种情况详析》:本文主要介绍MySQL查询优化中的11种常见情况,包括索引的使用和优化策略,通过这些策略,开发者可以显著提升查询性能,需要的朋友可以参考下... 目录前言图示1. 使用不等式操作符(!=, <, >)2. 使用 OR 连接多个条件3. 对索引字段进行计算操作4

MySQL表锁、页面锁和行锁的作用及其优缺点对比分析

《MySQL表锁、页面锁和行锁的作用及其优缺点对比分析》MySQL中的表锁、页面锁和行锁各有特点,适用于不同的场景,表锁锁定整个表,适用于批量操作和MyISAM存储引擎,页面锁锁定数据页,适用于旧版本... 目录1. 表锁(Table Lock)2. 页面锁(Page Lock)3. 行锁(Row Lock

MySQL zip安装包配置教程

《MySQLzip安装包配置教程》这篇文章详细介绍了如何使用zip安装包在Windows11上安装MySQL8.0,包括下载、解压、配置环境变量、初始化数据库、安装服务以及更改密码等步骤,感兴趣的朋... 目录mysql zip安装包配置教程1、下载zip安装包:2、安装2.1 解压zip包到安装目录2.2

MySQL安装时initializing database失败的问题解决

《MySQL安装时initializingdatabase失败的问题解决》本文主要介绍了MySQL安装时initializingdatabase失败的问题解决,文中通过图文介绍的非常详细,对大家的学... 目录问题页面:解决方法:问题页面:解决方法:1.勾选红框中的选项:2.将下图红框中全部改为英

MySQL 中的服务器配置和状态详解(MySQL Server Configuration and Status)

《MySQL中的服务器配置和状态详解(MySQLServerConfigurationandStatus)》MySQL服务器配置和状态设置包括服务器选项、系统变量和状态变量三个方面,可以通过... 目录mysql 之服务器配置和状态1 MySQL 架构和性能优化1.1 服务器配置和状态1.1.1 服务器选项

MySQL8.0设置redo缓存大小的实现

《MySQL8.0设置redo缓存大小的实现》本文主要在MySQL8.0.30及之后版本中使用innodb_redo_log_capacity参数在线更改redo缓存文件大小,下面就来介绍一下,具有一... mysql 8.0.30及之后版本可以使用innodb_redo_log_capacity参数来更改

Springboot中分析SQL性能的两种方式详解

《Springboot中分析SQL性能的两种方式详解》文章介绍了SQL性能分析的两种方式:MyBatis-Plus性能分析插件和p6spy框架,MyBatis-Plus插件配置简单,适用于开发和测试环... 目录SQL性能分析的两种方式:功能介绍实现方式:实现步骤:SQL性能分析的两种方式:功能介绍记录

使用 sql-research-assistant进行 SQL 数据库研究的实战指南(代码实现演示)

《使用sql-research-assistant进行SQL数据库研究的实战指南(代码实现演示)》本文介绍了sql-research-assistant工具,该工具基于LangChain框架,集... 目录技术背景介绍核心原理解析代码实现演示安装和配置项目集成LangSmith 配置(可选)启动服务应用场景

oracle DBMS_SQL.PARSE的使用方法和示例

《oracleDBMS_SQL.PARSE的使用方法和示例》DBMS_SQL是Oracle数据库中的一个强大包,用于动态构建和执行SQL语句,DBMS_SQL.PARSE过程解析SQL语句或PL/S... 目录语法示例注意事项DBMS_SQL 是 oracle 数据库中的一个强大包,它允许动态地构建和执行

SQL 中多表查询的常见连接方式详解

《SQL中多表查询的常见连接方式详解》本文介绍SQL中多表查询的常见连接方式,包括内连接(INNERJOIN)、左连接(LEFTJOIN)、右连接(RIGHTJOIN)、全外连接(FULLOUTER... 目录一、连接类型图表(ASCII 形式)二、前置代码(创建示例表)三、连接方式代码示例1. 内连接(I