목차
1. 环境说明
2. 案例:redo log文件(ib_logfile)大小参数被修改:innodb_log_file_size
3. 案例:ibdata1文件大小参数被修改:innodb_data_file_path
데이터 베이스 MySQL 튜토리얼 MySQL中ib_logfile和ibdata1参数大小被修改后_MySQL

MySQL中ib_logfile和ibdata1参数大小被修改后_MySQL

Jun 01, 2016 pm 01:02 PM
매개변수 크기

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

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

뜨거운 기사 태그

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

PHP 버전 5.4의 새로운 기능: 호출 가능 유형 힌트 매개변수를 사용하여 호출 가능 함수 또는 메서드를 허용하는 방법 PHP 버전 5.4의 새로운 기능: 호출 가능 유형 힌트 매개변수를 사용하여 호출 가능 함수 또는 메서드를 허용하는 방법 Jul 29, 2023 pm 09:19 PM

PHP 버전 5.4의 새로운 기능: 호출 가능 유형 힌트 매개변수를 사용하여 호출 가능 함수 또는 메서드를 허용하는 방법

i9-12900H 매개변수 평가 목록 i9-12900H 매개변수 평가 목록 Feb 23, 2024 am 09:25 AM

i9-12900H 매개변수 평가 목록

VirtualBox에서 디스크 크기를 늘리는 방법 [가이드] VirtualBox에서 디스크 크기를 늘리는 방법 [가이드] Mar 17, 2024 am 10:10 AM

VirtualBox에서 디스크 크기를 늘리는 방법 [가이드]

제품 매개변수는 무엇을 의미합니까? 제품 매개변수는 무엇을 의미합니까? Jul 05, 2023 am 11:13 AM

제품 매개변수는 무엇을 의미합니까?

주어진 값을 인수로 취하는 역쌍곡사인 함수의 값을 찾는 C++ 프로그램 주어진 값을 인수로 취하는 역쌍곡사인 함수의 값을 찾는 C++ 프로그램 Sep 17, 2023 am 10:49 AM

주어진 값을 인수로 취하는 역쌍곡사인 함수의 값을 찾는 C++ 프로그램

PHP 경고: in_array()에 대한 솔루션에는 매개변수가 필요합니다. PHP 경고: in_array()에 대한 솔루션에는 매개변수가 필요합니다. Jun 22, 2023 pm 11:52 PM

PHP 경고: in_array()에 대한 솔루션에는 매개변수가 필요합니다.

C++ 함수 매개변수 유형 안전성 확인 C++ 함수 매개변수 유형 안전성 확인 Apr 19, 2024 pm 12:00 PM

C++ 함수 매개변수 유형 안전성 확인

기계 학습 하이퍼파라미터 튜닝 요약(PySpark ML) 기계 학습 하이퍼파라미터 튜닝 요약(PySpark ML) Apr 08, 2023 pm 07:21 PM

기계 학습 하이퍼파라미터 튜닝 요약(PySpark ML)

See all articles