我知道我很笨,但这是一个生产数据库,我有很大的麻烦,我想访问数据库,我忘记了mysql密码,一件事让我到另一个,直到我删除了ibdata1(感谢chatgpt),现在我在紧要关头,mysql不启动,我不能访问任何东西。我只需要启动数据库,这样我就可以导出数据,如果可能的话。请帮帮我
root@localhost:~# systemctl start mysql
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xeu mysql.service" for details.
root@localhost:~# 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 Thu 2023-06-22 12:07:18 UTC; 14s ago
Process: 1641 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 1649 ExecStart=/usr/sbin/mysqld (code=exited, status=3)
Main PID: 1649 (code=exited, status=3)
Status: "Server startup in progress"
CPU: 294ms
Jun 22 12:07:18 localhost systemd[1]: mysql.service: Main process exited, code=exited, status=3/NOTIMPLEM>
Jun 22 12:07:18 localhost systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 22 12:07:18 localhost systemd[1]: Failed to start MySQL Community Server.
Jun 22 12:07:18 localhost systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Jun 22 12:07:18 localhost systemd[1]: Stopped MySQL Community Server.
Jun 22 12:07:18 localhost systemd[1]: mysql.service: Start request repeated too quickly.
Jun 22 12:07:18 localhost systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 22 12:07:18 localhost systemd[1]: Failed to start MySQL Community Server.
root@localhost:~# sudo tail -n 50 /var/log/mysql/error.log
2023-06-22T11:45:30.331779Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2023-06-22T11:45:30.932065Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 1347
2023-06-22T11:45:30.937894Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-22T11:45:31.003681Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2023-06-22T11:45:31.003698Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2023-06-22T11:45:31.003703Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2023-06-22T11:45:31.003709Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2023-06-22T11:45:31.003717Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2023-06-22T11:45:31.443411Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 1369
2023-06-22T11:45:31.448765Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-22T11:45:31.507675Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2023-06-22T11:45:31.507693Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2023-06-22T11:45:31.507698Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2023-06-22T11:45:31.507713Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2023-06-22T11:45:31.507718Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2023-06-22T12:07:15.741932Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 1564
2023-06-22T12:07:15.750132Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-22T12:07:15.815802Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2023-06-22T12:07:15.815828Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2023-06-22T12:07:15.815834Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2023-06-22T12:07:15.815845Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2023-06-22T12:07:15.815851Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2023-06-22T12:07:16.445381Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 1586
2023-06-22T12:07:16.452038Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-22T12:07:16.511688Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2023-06-22T12:07:16.511711Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2023-06-22T12:07:16.511717Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2023-06-22T12:07:16.511728Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2023-06-22T12:07:16.511733Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2023-06-22T12:07:16.992627Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 1607
2023-06-22T12:07:16.999282Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-22T12:07:17.071744Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2023-06-22T12:07:17.071769Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2023-06-22T12:07:17.071775Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2023-06-22T12:07:17.071780Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2023-06-22T12:07:17.071786Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2023-06-22T12:07:17.738538Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 1628
2023-06-22T12:07:17.744771Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-22T12:07:17.807827Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2023-06-22T12:07:17.807847Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2023-06-22T12:07:17.807853Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2023-06-22T12:07:17.807861Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2023-06-22T12:07:17.807866Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2023-06-22T12:07:18.184843Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.33-0ubuntu0.22.04.2) starting as process 1649
2023-06-22T12:07:18.190614Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-06-22T12:07:18.251677Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2023-06-22T12:07:18.251696Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2023-06-22T12:07:18.251710Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2023-06-22T12:07:18.251716Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2023-06-22T12:07:18.251721Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
1条答案
按热度按时间osh3o9ms1#
好吧,首先感谢每个人谁给了我的问题的时间,我是愚蠢的足以忘记AB使备份,但无论如何我得到了我的数据回来。我通过sftp将.ibd文件发送到mysql运行良好的windows中,然后创建一个新的数据库,从github中提取我的项目,应用迁移,然后用我导入的文件更改.ibd文件。最后我使用SQL Alter语句一个接一个地导入了所有表的表空间,这让我的数据回来了:)对于任何阅读本文的人,请备份您的数据库rn。你真的不想感受那种痛苦