Configuring MySQL for Power Failure
You can do many things to prevent this.


Move DB server to somewhere else (hosting)
Buy an UPS
Change to a simpler DB software (SQLite, Files)
Make your code to always save the latest changes, so when power up, programs keep running from last saved point.