I have apache and mysql running on mac os server (mavericks). I use some automation php scripts to sent queries to mysql db and also some other scripts that can be run on demand. Everything worked great, except when I tried to test what will happen if server will lose power for a moment. And.. everytime I do this database is all messed up. I can see my database and tables, but when I'm trying to access any of tables I'm getting an error that table does not exist. REPAIR and even CHECK says that tables don't exist (I checked files in mysql data folder and they're all here). I can't even remove them nor the database itself. I can see it's bad to database to break it's work like this.. but everytime? Is there any way (other than UPS) to improve mysql stability? If there's no good way to secure this maybe there're some scripts which can repair database after power loss?
Any help will be appreciated, Regards