My database has disappeared - error thrown when clicking on SQL databases in User Account Manager

judgedredd

New member
Joined
May 10, 2024
Messages
2
I have had forum software (phpBB) running on my site for over 10 years (with 6+ years in read only mode) without any issues whatsoever. But recently, like in the last week or so, the mysql server stopped working causing the forum to not load.
In my Direct Admin account under the Admin dashboard, on the right side 'Your Account' it shows the number of databases at 0.
When I try and go to the User Dashboard and click on the SQL databases icon two errors are thrown up. See image below:
mysql-error.jpg

When I go to the services monitor in the Admin dashboard, it shows the msqld server stopped:
service-monitor.jpg

I have tried restarting the mysqld server a few times by clicking on the + sign on the right and it comes up with an error message as well as a 'Success' message:
restart-error.jpg

How can I recover the database that was there and how do I resolve the issue of the mysqld server not working (or not getting it to restart) and the other issues that I am having? Also, is this a software error or a hardware error?

I may have a backup of the database but I do not have access to it at the moment (its on a hard drive in storage 30 miles from me) and I have not backed up the database within DirectAdmin.

By the way, I discovered all this when I tried to access my forum via my website and it came up with the following error:
general-error.jpg

I have looked over various posts on this issue here and I have tried finding where the log files are which is when I found files that were 1.8 or 1.9GB in size. They were called 'messages'. The current one (10th May 2024) had no dates attached to it whereas three others had dates 1 week apart. They started in April 2024.

I have not been able to find any error messages for the mysql server although it could be I am looking in the wrong place.

My installation is Alma Linux, and the main site is at this location: /var/www/html

I really hope that I can get this database back without having to go to the backup drive.
 

Attachments

  • mysql-error.jpg
    mysql-error.jpg
    175.7 KB · Views: 2
and the main site is at this location: /var/www/html
No it's not. At least it shouldn't be by default.

Anyway, you can see that the mysql service is stopped. So that is causing also that you can't see or reach your databases. Most likely they are still all present.
Logfile for mysql/mariadb normally is in the /var/lib/mysql directory, unless otherwise specified in the /etc/my.cnf file.

Question now is as to why mysql/mariadb stopped working.

Best is to login via SSH as root. Then try to start mysql.
service mysqld start

It might give an error, then additional info will be given, for example that you need to use journalctl -x to get a clue.
If so, then execute that journalctl -x command and post the output here.
 
I will add some notes to what Richard has already mentioned. Agree with him.

Question now is as to why mysql/mariadb stopped working.

The most common reasons are either power loss (or hard reset) or OOM Killer. Then can be caused by faulty upgrade attempt.

If a server runs out of free RAM, OOM Killer might kill a mysqld service. It usually brings to databases crashes, and usually crashed data is automatically repaired.

In any way it should be investigated through the logs and journals. And you might need to find the database dumps, in case you recover from them.
 
If the databases use InnoDB then that table may have crashed and you may have to start with recovery mode. https://mariadb.com/kb/en/innodb-recovery-modes/

Try the lowest recovery mode first. After you get it started you may need to dump all the data and start with a fresh database system and then recover from the dumps you made.

I had to do this recently and ended up being able to start it in read only mode. So I had to do the above.
 
Thanks chaps for all the responses. And, yes, my site was deliberately placed in the location I gave to use direct IP addressing.

I will check out the responses in the next few days and go through everything methodically. Thanks again.
 
Back
Top