Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Almost after each server crash, few last database records are deleted. How could I fix or workaround this? My distro is Ubuntu Server 9.10 and database MySql 5.1.37

share|improve this question
1  
Details please. We can't answer in a vacuum, although it sounds like a simple case of the logs not being flushed and thereby losing the uncommitted data. Of course the best solution is to fix whatever is causing your server to crash. They're not supposed to do that. –  John Gardeniers Jan 30 '10 at 21:13
add comment

1 Answer

You may want to change the type of Storage Engine you are using. Typically the default MyISAM engine works great for indexing while the InnoDB works great for foreign key constraints. These constraints can help you remove data from multiple tables when your initial query only appears to run against a single table. It almost sounds like you were running a transaction using a InnoDB Engine. Choose your database and then run the following to find out:

mysql> SHOW TABLE STATUS \G

You should be able to recover you records if you log them some where. Logging certainly puts a load on your system but if they exist you'll probably find them here (you should log while your building out anyway):

/var/log/mysql

You can change your settings here:

/etc/mysql/my.cnf

Don't forget to reboot after making changes. If you don't have logs try crashing your system intentionally after you do start logging. You may see a similar transaction occur during your intentional crash that will give you some more clues.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.