mysql服务器崩溃-mysqld收到信号6

时间:2018-10-04 05:54:59

标签: mysql

我正在使用mysql版本5.7.23,并且无法启动mysql服务器。

[ERROR] InnoDB: Space id and page no stored in the page, read in are [page id: space=3376699519, page number=1484718080], should be [page id: space=1463, page number=1] 2018-10-04T04:29:19.269829Z 0 [ERROR] InnoDB: Page [page id: space=3376699519, page number=1484718080] log sequence number 17294104044079415296 is in the future! Current system log sequence number 189601148. 2018-10-04T04:29:19.269834Z 0 [ERROR] 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/5.7/en/forcing-innodb-recovery.html for information about forcing recovery. 2018-10-04T04:29:19.269872Z 0 [ERROR] InnoDB: Database page corruption on disk or a failed file read of page [page id: space=1463, page number=1]. You may have to recover from a backup.

2 个答案:

答案 0 :(得分:2)

请检查innodb_force_recovery,将其设置为1并启动mysql。 有关更多详细信息,请阅读: enter link description here

答案 1 :(得分:1)

此错误表示数据库数据已损坏。您可以尝试以恢复模式启动mysql实例,如果幸运的话,将能够进行备份。 取决于所选模式表是只读的

警告:在恢复模式下启动服务之前,请备份数据文件

要以恢复模式启动mysql,请在您的mysql启动参数中添加--innodb_force_recovery=<mode>

mysql支持从06的值 Mysql recovery docs

docker-compose文件示例:

version: '2'
services:
  myservice-mysql:
    image: mysql:8.0.17
    volumes:
      - ~/volumes/MyProject/mysql/:/var/lib/mysql/
    environment:
      - MYSQL_USER=root
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
      - MYSQL_DATABASE=MyProject
    ports:
      - 3306:3306
    command: mysqld --innodb_force_recovery=6 --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp

如果mysql成功启动,则可以使用任何工具进行转储,可以在新的未损坏的mysql实例上还原