Mysql – Recover Mysql data

backupMySQL

I have a mysql database, and today I woke up and noticed that some of my tables are empty (like if they were truncated) but some aren't. This is not an SQL injection since I took care of that, but still haven't figured out what really happened.

Now I need to recover that data that was deleted, but the only thing I have are the lib files, so, is there a way to recover a database data using those files? We never deleted any file.

Basically I have ib_logfile, ibdata files but I never enabled Binary Logging.

Best Answer

if your MySQL contains binary logs then you can try mysqlbinlog to generate .sql file and execute insert the missing data manually example:

mysqlbinlog binary_log_file > query_log.sql