Internal server error - mariadb stopped

Hello ERPnext team,

Our setup:
desktop PC with windows10 as server.
Virtual box ubuntu OS 18.04.4.
We installed frappe image on it.
We have upgraded to erp 13 one month back safely and was working.

Suddenly we used faced problem of internal server error on server:8080 (localhost:8080). Usually when we restart erp this used to work. But this time it got stuck on internal server error.
When I found out in logs, mariadb was stopped.
There was corruption in files maybe due to improper shutdown.

I was browsing through erpnext forum and found this post.
Found this post
(https://github.com/frappe/erpnext/issues/12996)

This post explained:
sudo nano /etc/systemd/system/mysqld.service

On the file change

#LimitNOFILE=16364
LimitNOFILE=40000

Then enter the following commands

sudo mysqld --tc-heuristic-recover=ROLLBACK
sudo service mysql start

I tried this and still mariadb was not starting. One suggestion on website was to reinstall mariadb. So I did that and now mariadb is running.

I even tried editing mariadb configuration using
sudo nano /etc/mysql/my.cnf and feeding below text
https://discuss.erpnext.com/t/maria-db-configuration/33595/10

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

I also tried checking default directory using commands below

  • mysql -u root -p
  • select @@datadir;

and output was below:

+-----------------+
| @@datadir       |
+-----------------+
| /var/lib/mysql/ |
+-----------------+
1 row in set (0.00 sec)

But still getting internal server error on localhost:8080

This is my current status on mariadb and mysql

Please help. What else I need to do?

Thanks in advance,

Macjan