techloris_109
techloris_109

Reputation: 665

Can I recover dropped database in MySQL?

I accidentally dropped a database which I used for my web application, and it is in MySQL. Browsing through the internet I found out that to recover you need to have binary logs enabled. Read that binary logs records only changes in tables, so what it has to do with recovering a db. Upon executing the command "show binary logs;" console shows me "Error Code: 1381. You are not using binary logging". I am a newbie to MySQL, so is it possible to recover it without my binary logging enabled PLUS I have not made any real backup for the db. Going through the MySQL "my.cnf" file found that InnoDB is default enabled, can it help me recover.

If I cannot recover, please mention the steps to be carried out next time creating a new db to ensure that I could recover even if it has been accidentally deleted.

Upvotes: 0

Views: 2470

Answers (1)

liyj144
liyj144

Reputation: 110

I think it can't be recovered. In case of this case, you can do the following when creating a new db:

  1. open the binary log by add the following:

    log-bin=/data/mysqlbinlog/mysql-bin binlog-format=mixed (or row)

  2. create a slave db.

Good luck for you.

Upvotes: 1

Related Questions