我备份了mysql数据库,然后尝试使用xtrabackup在更高版本中恢复它,mysql服务无法启动。
旧mysql版本:5.0.90;
新版本:5.5.31
恢复步骤:
innobackupex --use-memory=4G --apply-log/data/backups/2010-03-13_02-42-44/
innobackupex --copy-back/data/backups/2010-03-13_02-42-44/
第二步显示xtrabackup完全恢复了mysql数据库。
sudo mysql服务启动mysql
我尝试启动mysql服务,它显示“Job failed to start”。我检查这些数据库文件的权限,如下所示。
-rw-r--r-- 1 mysql mysql 209715200 7月 11 06:02 ibdata1 -rw-r--r-- 1 mysql mysql 1048576000 7月 11 06:03 ib_logfile0 -rw-r--r-- 1 mysql mysql 1048576000 7月 11 06:03 ib_logfile1 drwxr-xr-x 2 mysql mysql 4096 7月 11 06:02 mysql drwxr-xr-x 2 mysql mysql 12288 7月 11 06:02 sp5084afbe48ce9 drwxr-xr-x 2 mysql mysql 4096 7月 11 06:02 test -rw-r--r-- 1 mysql mysql 52 7月 11 06:02 xtrabackup_binlog_pos_innodb -rw-r--r-- 1 mysql mysql 76 7月 11 06:02 xtrabackup_slave_info
这是错误:
InnoDB: Error: log file ./ib_logfile0 is of different size 0 1048576000 bytes InnoDB: than specified in the .cnf file 0 5242880 bytes! 130711 6:08:56 [ERROR] Plugin 'InnoDB' init function returned error. 130711 6:08:56 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 130711 6:08:56 [ERROR] Unknown/unsupported storage engine: InnoDB 130711 6:08:56 [ERROR] Aborting 130711 6:08:56 [Note] /usr/sbin/mysqld: Shutdown complete
最佳答案
检查/etc/mysql/my.cnf
并查找
innodb_log_file_size = 5M
并将其更改为
innodb_log_file_size = 1000M
原因 1048576000/1024/1024=1000,这就是 InnoDB 引擎期望的日志文件大小。
关于mysql - 使用 xtrabackup 恢复 mysql 的物理备份,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17590972/