CentOS 7 - MySQL 5.7 re-installation corrupted data

1.2k Views Asked by At

I have a CentOS 7 virtual machine with a DirectAdmin installation. It used to run a MySQL 5.6 installation, built using DirectAdmin Custombuild 2.0. I wanted some functionality (e.g. JSON ops) that was not available in MySQL 5.6, so I manually installed MySQL 5.7 from the MySQL repo using the guide on https://www.tecmint.com/install-latest-mysql-on-rhel-centos-and-fedora/.

This worked fine up until a few days ago, when I needed to rebuild my Custombuild installation and it obviously overwrote the MySQL installation with version 5.6. I did NOT make a backup of the databases (I know, really stupid and I regret it).

After the Custombuild overwrite, I re-installed MySQL 5.7 using the same guide. When I now try to start it, I get the following:

[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.

The log in /var/log/mysqld.log says the following:

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

Hence, it looks like the InnoDB data is corrupted. I tried starting using

[mysqld]
innodb_force_recovery = x

in /etc/my.cnf with values 1-6 for x. This didn't help. As for my question: is there any chance of recovering the data, with or without the help of MySQL?

0

There are 0 best solutions below