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 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 ?

Thanks

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Check out aspersa's 'stalk' and 'collect' tools: http://aspersa.googlecode.com/svn/html/stalk.html. 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. –  RULE101 Nov 6 '10 at 11:30
2  
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
add comment
  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
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.