完整MySQL错误日志:https://pastebin.com/20QX1ZSc
一夜之间,我的MySQL安装突然停止工作。。。我正在使用ubuntu 20.04
systemctl:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-05-13 14:50:18 CEST; 17min ago
Process: 4562 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 4570 ExecStart=/usr/sbin/mysqld (code=exited, status=3)
Main PID: 4570 (code=exited, status=3)
Status: "Server startup in progress"
May 13 14:50:18 vault systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
May 13 14:50:18 vault systemd[1]: Stopped MySQL Community Server.
May 13 14:50:18 vault systemd[1]: mysql.service: Start request repeated too quickly.
May 13 14:50:18 vault systemd[1]: mysql.service: Failed with result 'exit-code'.
May 13 14:50:18 vault systemd[1]: Failed to start MySQL Community Server.
/var/log/mysql:
2021-05-13T12:50:18.017977Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.25-0ubuntu0.20.04.1) starting as process 4570
2021-05-13T12:50:18.032753Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-05-13T12:50:18.194467Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-05-13T12:50:18.428966Z 1 [Warning] [MY-012637] [InnoDB] 16384 bytes should have been read. Only 12288 bytes read. Retrying for the remaining bytes.
2021-05-13T12:50:18.604489Z 1 [Warning] [MY-012638] [InnoDB] Retry attempts for reading partial data failed.
2021-05-13T12:50:18.604910Z 1 [ERROR] [MY-012642] [InnoDB] Tried to read 16384 bytes at offset 16498688, but was only able to read 12288
2021-05-13T12:50:18.605273Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 5 in a file operation.
2021-05-13T12:50:18.605645Z 1 [ERROR] [MY-012596] [InnoDB] Error number 5 means 'Input/output error'
2021-05-13T12:50:18.606374Z 1 [ERROR] [MY-012646] [InnoDB] File mysql.ibd: 'read' returned OS error 105. Cannot continue operation
2021-05-13T12:50:18.606762Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
看起来像是数据/文件损坏。尝试以下步骤:
- 删除-->下的syslog条目/etc/mysql/conf.d/mysqld_safe_syslog.cnf
- 备份&删除ib_logfile0&ib_logfile1文件位于-->var/lib/mysql
- 从-->中删除条目innodb_force_recovery=1;etc/mysql/my.cnf
- run命令-->
sudo service mysql start
reference Forcing InnoDB Recovery