如何从损坏的 SSD 恢复 MySQL 数据库?

如何从损坏的 SSD 恢复 MySQL 数据库?

我的 SSD 损坏了。我在 HDD 上克隆了它,并且可以访问全部原始文件来自/var/lib/mysql/that_database

我想导that_database回来,但是不能。

我已经尝试过

复制数据库文件本身

我尝试复制原始文件,但没有成功:show tables可以,但查询以that_database.TableName不存在

复制整个/var/lib/mysql目录

another_database和数据库之一sys已损坏。复制文件后,我尝试重新启动服务器,但无法启动。

$ sudo service mysql start
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
$ systemctl status mysql.service
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2018-04-23 13:50:01 EEST; 2s ago
  Process: 23954 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
  Process: 23945 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 22245 (code=exited, status=0/SUCCESS)

apr 23 13:50:01 notebook systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
apr 23 13:50:01 notebook systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
apr 23 13:50:01 notebook systemd[1]: Stopped MySQL Community Server.
apr 23 13:50:01 notebook systemd[1]: mysql.service: Start request repeated too quickly.
apr 23 13:50:01 notebook systemd[1]: mysql.service: Failed with result 'exit-code'.
apr 23 13:50:01 notebook systemd[1]: Failed to start MySQL Community Server.

我怎样才能恢复该数据库?

相关内容