简体   繁体   English

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

[英]mysql server crashed -mysqld got signal 6

我正在使用 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.

Please check the innodb_force_recovery, set it to 1, and start mysql.请检查innodb_force_recovery,设置为1,然后启动mysql。 for more details, please read this有关更多详细信息,请阅读此内容

This error means that Database Data is corrupted.此错误意味着数据库数据已损坏。 You can try to start mysql instance in recovery mode and you will be able to do backup if you are lucky.您可以尝试在恢复模式下启动 mysql 实例,如果幸运的话,您将能够进行备份。 Depends on selected mode tables could be read only取决于选定的模式表可以是只读的

WARNING: Backup data files before starting service in recovery mode警告:在恢复模式下启动服务之前备份数据文件

To start mysql in recovery mode add --innodb_force_recovery=<mode> in your mysql startup parameter要以恢复模式启动 mysql,请在 mysql 启动参数中添加--innodb_force_recovery=<mode>

mysql supporting values from 0 to 6 Mysql recovery docs mysql 支持从06Mysql 恢复文档

Example of docker-compose file: 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

If mysql started successfully you can use any tool to do dump which you can restore on new not corrupted mysql instance如果 mysql 成功启动,您可以使用任何工具进行转储,您可以在新的未损坏的 mysql 实例上恢复

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM