Check power supply and exchange power supply USB cable (if possible) for diagnosing:
Also make sure not too many power hungry USB devices are connected to Pi that might cause under-voltage brownouts.
And always try to properly shutdown the Pi instead of just unplugging the power.
A power outage can also sometimes corrupt files.
If the dbase was corrupted, there is a possibility that other files got corrupted too.
To check, you would have to insert the SD card into another Linux host and run the filesystem checker tool fsck
on the two partitions (FAT32 & EXT4) contained on the SD card.