1

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

1
  • 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. Jan 30, 2010 at 21:13

1 Answer 1

2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .