Home >Database >Mysql Tutorial >如何正确的给innodb表空间添加数据文件_MySQL

如何正确的给innodb表空间添加数据文件_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:49:37963browse

bitsCN.com

重启MySQL时遇到下边错误

InnoDB: Error: data file /usr/local/mysql/data/ibdata1 is of a different size

InnoDB: 1152 pages (rounded down to MB)

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

找到原因是因为给mysql添加数据文件没有正确配置引起,查看一下当前数据文件的大小

l# ll -h /usr/local/mysql/data/

-rw-rw---- 1 mysql mysql 18M Mar 5 03:01 ibdata1

修改my.cnf

innodb_data_home_dir =

innodb_data_file_path = /usr/local/mysql/data/ibdata1:18M;/data2/ibdata2:50M:auto extend

这里要特别指出

  1. linux下查看到数据文件是多大就要填写多大,填大填小都不行。
  2. /data2/ibdata2这个目录/data2需要提前建立,但是ibdata2这个文件不可以存在

随后重启就无提示错误就ok了。

# /etc/init.d/mysql.server stop

Shutting down MySQL

... *

# /etc/init.d/mysql.server start

Starting MySQL

... *

--EOF--

innodb作者:Buro#79xxd出处:http://www.cnblogs.com/buro79xxd/文章版权归本人所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn