I recently updated my docker container to the latest, and it wasn't until a few days later that I realised the upgrade had corrupted a database (unsure which one) and I am now unable to start the DB.
The container logs are lots of this:
2025-01-08T09:37:08.031157Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 106 = ['data/nextcloud/oc_users.ibd', 'nextcloud/oc_files_reminders.ibd']
2025-01-08T09:37:08.031161Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967278 = ['data/undo_002', 'undo_002']
2025-01-08T09:37:08.031168Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967279 = ['data/undo_001', 'undo_001']
2025-01-08T09:37:08.031172Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967294 = ['data/mysql.ibd', 'mysql.ibd']
2025-01-08T09:37:08.031200Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2025-01-08T09:37:08.031259Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2025-01-08T09:37:08.031343Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-01-08T09:37:08.031355Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-01-08T09:37:08.032354Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0) MySQL Community Server - GPL.
2025-01-08T09:37:08.032361Z 0 [System] [MY-015016] [Server] MySQL Server - end.
And the error log within the containers directory looks like this:
2024-09-01T11:23:49.139075Z 0 [System] [MY-015016] [Server] MySQL Server - end.
2024-09-01T11:23:49.660883Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-09-01T11:23:49.865552Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.0) starting as process 1
2024-09-01T11:23:49.866700Z 0 [Warning] [MY-010122] [Server] One can only use the --user switch if running as root
2024-09-01T11:23:49.869405Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-09-01T11:23:49.992103Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-09-01T11:23:50.177701Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-09-01T11:23:50.177730Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-09-01T11:23:50.182927Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2024-09-01T11:23:50.203895Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.0' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
2024-09-01T11:23:50.457721Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2024-09-01T11:26:31.878111Z 0 [ERROR] [MY-011906] [InnoDB] Database page corruption on disk or a failed file read of page [page id: space=4294967293, page number=3]. You may have to recover from a backup.
Then after a bit of research, it seems like I need to run the innodb-recovery tool as shown here: https://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
However the container directory does not contain the my.conf file that it is referring to, so I have no idea where to put this [mysqld] innodb_force_recovery = 1 line.
Has anyone come across this? Extremely frustrating