I know i am dumb, but it's a production database and i am in huge trouble, I wanted to access the db and i forgot the mysql password, one thing led me to another, till i deleted the ibdata1 (thanks to chatgpt) and now i am in a pinch, mysql doesn't start and i can't access anything. I just need to start the database so i can export the data if it's possible. Please help me.
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.
Well first of all thanks to everyone who gave time for my issue, I was dumb enough to forget ab making a backup but anyways I got my data back. I sent the .ibd files via sftp into windows where mysql is working well, then created a new database, pulled my project from github, applied the migrations then changed the .ibd files with the ones that I imported. finally I Imported the tablespaces of all the tables one by one using the SQL Alter statement, which got my data back :) For anyone reading this please backup your databases rn. you really don't wanna feel that pain