MySQL的数据迁移,注意检查innodb_log_file_size

MySQL的数据迁移比较简单,但有几点一定要注意:

MySQL的数据迁移,注意检查innodb_log_file_size

当启用InnoDB引擎,在my.ini中有一个配置项:innodb_log_file_size

必须保证移植前后这个配置值是相同的,不然服务无法启动

如果不知道这个值咋办呢,查看日志

 

Log代码
  1. InnoDB: Error: log file .ib_logfile0 is of different size 0 359661568 bytes
  2. InnoDB: than specified in the .cnf file 0 56623104 bytes!
  3. 140525 17:21:20 [ERROR] Plugin ‘InnoDB’ init function returned error.
  4. 140525 17:21:20 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
  5. 140525 17:21:20 [ERROR] Unknown/unsupported table type: INNODB
  6. 140525 17:21:20 [ERROR] Aborting

我们看看到,日志很清楚的显示了原来的innodb_log_file_size和现在的innodb_log_file_size,把现在的配置改为原来的即可。

或者改名 ib_logfile0 和ib_logfile1 ,启动mysql服务