Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check who deleted a table in mysql database

Tags:

logging

mysql

I have a MySQL database that is accessed by many users. Today, I noticed that suddenly some of the tables disappeared, probably someone deleted them.

Is there a possibility to check which user did that? A log or something? Is this stored somewhere?

Thank you in advance.

like image 542
Milos Cuculovic Avatar asked Mar 17 '14 09:03

Milos Cuculovic


People also ask

How can I see who deleted a table in SQL?

Right click SQL Server Instance and Select Reports -> Standard Reports -> Schema Changes History as shown in the below snippet. 3. This will open up Scheme Changes History report which will have the details about who deleted the SQL Server Database along with the timestamp when the database was deleted.

What does flush logs do in MySQL?

A log-flushing operation has the following effects: If binary logging is enabled, the server closes the current binary log file and opens a new log file with the next sequence number. If general query logging or slow query logging to a log file is enabled, the server closes and reopens the log file.

Is deletion possible in MySQL?

The Delete query in MySQL can delete more than one row from a table in a single query. This proves to be advantages when removing large numbers of rows from a database table. Once a Delete row in MySQL row has been deleted, it cannot be recovered.


1 Answers

The only way, in my opinion, is to check the MySQL server Logs, read the documentation about statements, which changes the data here.

If you have access to the file system of your MySQL server this would not be hard, just locate where is the log. By default, the server writes files for all enabled logs in the data directory.

like image 147
Bud Damyanov Avatar answered Oct 13 '22 11:10

Bud Damyanov