InterWorx Cannot Connect to MySQL/MariaDB

InterWorx Version: InterWorx-CP v7.13.45
Distribution: AlmaLinux release 8.10 (Cerulean Leopard)
Operating System: Linux 4.18.0-553.16.1.el8_10.x86_64 (SMP)

Just in the last 24-48 hours I noticed all the hosted sites were showing blank areas on the web page for the data being retrieved from the DB.

It is exactly like this guide for troubleshooting: InterWorx Cannot Connect to MySQL/MariaDB — InterWorx documentation

Screenshots are all identical under “How the Issue Manifests”. When I followed the instructions like trying to access MySQL/MariaDB at the CLI as the iworx user I get the following message: “ERROR 2002 (HY000): Can’t connect to local server through socket ‘/var/lib/mysql/mysql.sock’ (111)”. I also tailed ~iworx/var/log/iworx.log where I saw “db_connect failed… sleeping 5 seconds…”.

I then followed the section “How to Resolve” where I try to log into the server MariaDB/MySQL instance as the mysql root user which produces the same message: “ERROR 2002 (HY000): Can’t connect to local server through socket ‘/var/lib/mysql/mysql.sock’ (111)”.

I have also carried out “To Check the Permissions on /var/lib/mysql” which produces “drwxr-xr-x” which I believe translates to 755.

There is enough disk space and all the hardware like CPU, Disk and Memory look good.

I don’t understand how this has suddenly happened. Any help would be greatly appreciated.

With further investigation and I’ve managed to resolve this. I will leave this here I guess? (for others that might come across the same issue).

I ran the following command: journalctl -u mariadb -xe

One of the lines had the following error:
[ERROR] InnoDB: Plugin initialization aborted with error Generic error

This error, combined with the subsequent messages, suggested that InnoDB encountered a corrupted page or some other serious issue that prevented it from starting up properly.

Edited the following file: /etc/my.cnf and added:
[mysqld]
innodb_force_recovery = 1

systemctl restart mariadb

This fixed the issue.

As this line is a temporary fix I then removed/commented: innodb_force_recovery = 1 in /etc/my.cnf

systemctl restart mariadb