Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Almost once in 2 weeks,i am facing mysql data loss in a table. almost 600 rows are being deleted. I cant trace that issue.

What may cause this or how can i trace who/what makes it ?


share|improve this question
up vote 1 down vote accepted

Check out aspersa's 'stalk' and 'collect' tools: Smart use of those should eliminate the need to enable the general query log, which probably gathers way too much data in two weeks to justify.

Other then that: tell us more about your setup: do you run replication? What kind of applications? Who has what kind of access? Do you have any suspects?

share|improve this answer
There is only one user who can access. I dont have any suspect. Its self built php application. Normally when user deletes a row, query is DELETE FROM table WHERE user_id = 'ID' and that id posted by AJAX. maybe there would be an error about that. dunno, still investigating. – Utku Dalmaz Nov 6 '10 at 11:30
Do you mean that the whole "DELETE FROM table..." query is generated and submitted via AJAX? If so, that's a very big security hole, and something that you ought to change as soon as possible. – EEAA Nov 6 '10 at 13:49
  1. Enable query log (please pay attention to the performance caveats listed on that page)
  2. Wait for said data loss to occur
  3. Examine query log to see what happened
  4. Profit?

In addition to the above steps, I'd also recommend doing a comprehensive audit of your grants to see what user accounts might have access to this database that shouldn't have access.

share|improve this answer

Your Answer


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.