Question

So I just noticed one of my table have been dropped/deleted, I am using MySQL anyway I can trace or see logs of this?

I have no idea where to start look.

Était-ce utile?

La solution

If you have binary logging enabled, you could probably see the DROP TABLE command in the binlog. However, that won't help you get the table back, of course. You would need to restore your data from a backup.

Autres conseils

I hope you are keeping regular backups.

The next question is, why has this happened? Is your site vulnerable to SQL injection? Building SQL queries/statements with 'literals' from an external source, is inherently vulnerable.

For example: "select * from CUSTOMER where name='".cust_name."'", and all queries/statements like it, are vulnerable to attack.

Calling from the web such that cust_name=test';drop table CUSTOMER; supplies the closing apostrophe, issues a semicolon to complete the statement and then issues malicious commands which will be executed.

You should use parameterized queries and bind parameters explicitly.

See: http://en.wikipedia.org/wiki/SQL_injection

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top