Score:1

MySQL Corrupted After System Crash

cn flag

I'm using MacOS Monterey 12.6.1 with Homebrew 3.6.6 and MariaDB 10.8.3

The OS crashed out of nowhere and rebooted itself. After the reboot I was unable to connect to the database: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Current results of "mysqld" command:

[Note] mysqld (server 10.8.3-MariaDB) starting as process 12300 ...
[Warning] Setting lower_case_table_names=2 because file system for /opt/homebrew/var/mysql/ is case 
[Note] InnoDB: Compressed tables use zlib 1.2.11
[Note] InnoDB: Number of transaction pools: 1
[Note] InnoDB: Using generic crc32 instructions
[Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
[Note] InnoDB: Completed initialization of buffer pool
[ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 
[ERROR] InnoDB: Plugin initialization aborted with error Generic error
[Note] InnoDB: Starting shutdown...
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[Note] Plugin 'FEEDBACK' is disabled.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting

And the error log is as follows:

mysqld_safe mysqld from pid file /opt/homebrew/var/mysql/crtx.pid ended
mysqld_safe Starting mariadbd daemon with databases from /opt/homebrew/var/mysql
[Note] /opt/homebrew/Cellar/mariadb/10.8.3_1/bin/mariadbd (server 10.8.3-MariaDB) starting as process 9036 ...
[Warning] Setting lower_case_table_names=2 because file system for /opt/homebrew/var/mysql/ is case insensitive
[Note] InnoDB: !!! innodb_force_recovery is set to 1 !!!
[Note] InnoDB: Compressed tables use zlib 1.2.11
[Note] InnoDB: Number of transaction pools: 1
[Note] InnoDB: Using generic crc32 instructions
[Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
[Note] InnoDB: Completed initialization of buffer pool
[ERROR] InnoDB: File ./ib_logfile0 was not found
[ERROR] InnoDB: Plugin initialization aborted with error Generic error
[Note] InnoDB: Starting shutdown...
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[Note] Plugin 'FEEDBACK' is disabled.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting

I upgraded to the new MariaDB version via Homebrew but it didn't work because it was corrupted. As far as I understand it is not possible to downgrade to its original version anymore.

I tried the ib_logfile* deletion method but it didn't work. I tried to fix it by giving "innodb_force_recovery=1 / 2 / 3" parameters in my.cnf, the result is frustration again.

I have 1 month of work inside and I don't have up-to-date backup.

Is there any way to fix the server and get it working again?

Or at least recover the database inside? That way I can do a clean install and create the tables again...

Rawkon avatar
cn flag
@RobertLongson `Warning: [email protected] has been deprecated because it is not supported upstream!`
Rawkon avatar
cn flag
@RobertLongson The previous version could no longer be installed because it's deprecated. If I do uninstall-reinstall, won't all databases be completely deleted? My goal is just to be able to recover the data inside.
Rawkon avatar
cn flag
@RobertLongson Thank you for your guidance. I've successfully downgraded to the relevant version but another problem occurred now. So I'll continue with a new topic.
br flag
OK, I've converted my comments to an answer.
Score:0
br flag

You should be able to

brew uninstall mariadb
brew install [email protected]

That will install the old version and yet keep your databases. The Upgrade after a crash is not supported error should then go away.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.