I have a system based on a RPi, which runs, amongst other things, Apache and MySQL. The Web Server front end collects data and writes it into the MySQL database (relatively infrequently). A compiled 'C' program runs in an infinite loop in the background, reading the data out of the MySQL database.
After being used for a few hours, the user just switches off the power to the whole system. I am confident that at this time no User Data is being written into the database.
however, very occasionally, on startup, the C program will run for a few seconds, then crash. I'm beginning to suspect that this is due to the MySQL database being corrupted. (OK, my error handling is non-existent, but the system is headless anyway so there's not much I can do!).
So my question, or questions, are:
1. Could READING from the database at the time of power-off cause database corruption ?
2. Or, Is it possible that the MySQL server is doing something in the background on my database, which could cause corruption if the power suddenly goes off?
Any information welcome!