简体   繁体   中英

accidentally deleted mysql database

I was working with netbean's database explorer (services tab) and accidentally deleted one of the databases.

I was trying to connect to a database and there were 2 options in the context menu for connecting.

1)Connect 2)Delete

I accidentally hit delete. It did not even ask me for confirmation. Is there anyway to recover the database?

I don't have access to mysql server. I can just connect to the database using mysql workbench.

Thanks a ton!

If you have the binary logging enabled, then you might have a chance to use it to restore your database.
Else use an older backup and restore it !


To find binary logs status :

mysql> show variables like '%bin%';
+---------------------------------+----------------------+
| Variable_name                   | Value                |
+---------------------------------+----------------------+
| binlog_cache_size               | 32768                |
| innodb_locks_unsafe_for_binlog  | OFF                  |
| log_bin                         | OFF                  |
| log_bin_trust_function_creators | OFF                  |
| max_binlog_cache_size           | 18446744073709547520 |
| max_binlog_size                 | 1073741824           |
| sync_binlog                     | 0                    |
+---------------------------------+----------------------+
7 rows in set (0.00 sec)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM