# InterWorx Cannot Connect to MySQL/MariaDB

**URL:** <https://forums.interworx.com/t/interworx-cannot-connect-to-mysql-mariadb/23701>\
**Category:** General Inquries\
**Created:** [August 17, 2024, 1:35pm UTC](https://forums.interworx.com/t/interworx-cannot-connect-to-mysql-mariadb/23701 "2024-08-17T13:35:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![operator](https://forums.interworx.com/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@operator](https://forums.interworx.com/u/operator)\
**Post date:** [August 17, 2024, 1:35pm UTC](https://forums.interworx.com/t/interworx-cannot-connect-to-mysql-mariadb/23701/1 "2024-08-17T13:35:15Z")

</div>

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](https://appendix.interworx.com/current/troubleshooting/mysql/connection-issue-mariadb.html)

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.

---

<div class="post-metadata">

**Author:** ![operator](https://forums.interworx.com/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@operator](https://forums.interworx.com/u/operator)\
**Post date:** [August 17, 2024, 8:56pm UTC](https://forums.interworx.com/t/interworx-cannot-connect-to-mysql-mariadb/23701/2 "2024-08-17T20:56:59Z")

</div>

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
