首页 > 解决方案 > CentOS 7 - MySQL 5.7 重新安装损坏数据

问题描述

我有一个安装了 DirectAdmin 的 CentOS 7 虚拟机。它曾经运行 MySQL 5.6 安装,使用 DirectAdmin Custombuild 2.0 构建。我想要一些 MySQL 5.6 中不可用的功能(例如 JSON 操作),所以我使用https://www.tecmint.com/install-latest-mysql-on-rhel上的指南从 MySQL 存储库手动安装了 MySQL 5.7 -centos 和 Fedora/

这一直很好,直到几天前,当我需要重建我的 Custombuild 安装时,它显然用 5.6 版覆盖了 MySQL 安装。我没有备份数据库(我知道,真的很愚蠢,我很后悔)。

在 Custombuild 覆盖之后,我使用相同的指南重新安装了 MySQL 5.7。当我现在尝试启动它时,我得到以下信息:

[riccardo@server ~]$ sudo systemctl start mysqld
[sudo] password for riccardo: 
Job for mysqld.service failed because the control process exited with        
error code. See "systemctl status mysqld.service" and "journalctl
-xe" for details.

/var/log/mysqld.log中的日志显示以下内容:

2018-05-27T17:42:02.769069Z 0 [Warning] TIMESTAMP with implicit
DEFAULT value is deprecated. Please use
--explicit_defaults_for_timestamp server option (see documentation for
more details).
2018-05-27T17:42:02.770667Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.22)
starting as process 31752 ...
2018-05-27T17:42:02.773699Z 0 [Note] InnoDB: PUNCH HOLE support
available
2018-05-27T17:42:02.773726Z 0 [Note] InnoDB: Mutexes and rw_locks use
GCC atomic builtins    
2018-05-27T17:42:02.773731Z 0 [Note] InnoDB: Uses event mutexes
2018-05-27T17:42:02.773734Z 0 [Note] InnoDB: GCC builtin
__atomic_thread_fence() is used for memory barrier
2018-05-27T17:42:02.773739Z 0 [Note] InnoDB: Compressed tables use
zlib 1.2.3
2018-05-27T17:42:02.773742Z 0 [Note] InnoDB: Using Linux native AIO
2018-05-27T17:42:02.773999Z 0 [Note] InnoDB: Number of pools: 1
2018-05-27T17:42:02.774100Z 0 [Note] InnoDB: Using CPU crc32
instructions
2018-05-27T17:42:02.775492Z 0 [Note] InnoDB: Initializing buffer pool,
total size = 128M, instances = 1, chunk size = 128M
2018-05-27T17:42:02.783306Z 0 [Note] InnoDB: Completed initialization
of buffer pool
2018-05-27T17:42:02.786037Z 0 [Note] InnoDB: If the mysqld execution
user is authorized, page cleaner thread priority can be changed. See
the man page of setpriority().
2018-05-27T17:42:02.797885Z 0 [ERROR] [FATAL] InnoDB: Table flags are
0 in the data dictionary but the flags in file ./ibdata1 are 0x4000!
2018-05-27 19:42:02 0x7efd82b32740  InnoDB: Assertion failure in
thread 139627284604736 in file ut0ut.cc line 942

因此,看起来 InnoDB 数据已损坏。我尝试开始使用

[mysqld]
innodb_force_recovery = x

/etc/my.cnf中,x 的值为 1-6。这没有帮助。至于我的问题:有没有可能在 MySQL 的帮助下恢复数据?

标签: mysqlcentos7directadmincustom-build

解决方案


推荐阅读