1

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

Utku Dalmaz
  • 1,309
  • 2
  • 12
  • 18

2 Answers2

3
  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.

EEAA
  • 108,414
  • 18
  • 172
  • 242
1

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?

Walter Heck
  • 92
  • 2
  • 7
  • 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 06 '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 06 '10 at 13:49