报错信息
Need to create a new innodb_system data file ‘ibdata2’.
2021-02-05T09:08:21.996961+08:00 0 [ERROR] InnoDB: The innodb_system data file ‘/data2/app_backup/mysql5.7.33/3306_3306/data/ibdata1’ is of a different size 1755776 pages (rounded down to MB) than the 8192 pages specified in the .cnf file!
原因
在使用xtrabackup备份恢复的过程中,如果源库与目标库配置文件中的参数innodb_data_file_path的值不同,就会出现以上报错。
解决方法
方法1
修改配置文件my.cnf,确保目标库的innodb_data_file_path值与源库相同。
方法2
根据报错信息计算出正确的数值。
175577616/1024 = 27434M*
innodb_data_file_path = ibdata1:27434M:autoextend
方法3
#启动服务前注释下面这行
#innodb_data_file_path = ibdata1:128M:autoextend