我正在尝试导入MySQL数据库及其关联的条目。我一直在简单地复制旧数据库文件夹并尝试使用innodb_force_recovery = 0
进行转换时遇到问题。说不到5.7版的转换时遇到问题给了我一个问题。我在旧数据库文件夹中有一组.frm
文件,还有一个db.opt
文件。我也有旧的ib_logfile0
,ib_logfile1
和和ib_data1
文件。有什么方法可以将旧数据库导入到较新的MySQL中?
这是我简单地复制文件时得到的日志:
2019-03-01T11:00:54.514854Z 0 [System] [MY-010116] [Server] D:\mysql-8.0.15\bin\mysqld.exe (mysqld 8.0.15) starting as process 6152
2019-03-01T11:00:54.608784Z 1 [ERROR] [MY-013090] [InnoDB] Unsupported redo log format (0). The redo log was created before MySQL 5.7.9
2019-03-01T11:00:54.608827Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2019-03-01T11:00:54.810243Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2019-03-01T11:00:54.810808Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-03-01T11:00:54.823309Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-03-01T11:00:54.824368Z 0 [System] [MY-010910] [Server] D:\mysql-8.0.15\bin\mysqld.exe: Shutdown complete (mysqld 8.0.15) MySQL Community Server - GPL.
如果我尝试删除旧的ib_logfile0
和ib_logfile1
,则会得到以下内容,即是这些类型的行的负载:
2019-03-01T11:04:21.468566Z 1 [ERROR] [MY-011971] [InnoDB] Tablespace 'innodb_system' Page [page id: space=0, page number=498] log sequence number 5740975 is in the future! Current system log sequence number 5735982.
2019-03-01T11:04:21.468576Z 1 [ERROR] [MY-011972] [InnoDB] Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html for information about forcing recovery.
然后:
2019-03-01T11:04:22.178122Z 1 [ERROR] [MY-013168] [InnoDB] Cannot upgrade server earlier than 5.7 to 8.0
2019-03-01T11:04:27.326810Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2019-03-01T11:04:27.327338Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2019-03-01T11:04:29.491301Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-03-01T11:04:29.492505Z 0 [System] [MY-010910] [Server] D:\mysql-8.0.15\bin\mysqld.exe: Shutdown complete (mysqld 8.0.15) MySQL Community Server - GPL.