469,578 Members | 1,869 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

how to restore MySQL database?

I wanted to have another database on the hosting, clicked "Create database", entered a new password, and realized that the database was created on top of the previous one.

no backups. how to get everything back?
I didn't press anything else.

there are these buttons:

Create a database
To create an additional database
To remove an additional database
Database manager
Command line monitor

Please do not condemn, but to suggest how it is possible to get it back.
Thanks in advance.
Jul 6 '18 #1
1 2539
zmbd
5,400 Expert Mod 4TB
1) Contact your Host ASAP - they may do backups and might be able to assist you. I know that several hosts have such information in their "Self-Care" sections.

2) If you are using SSMS you might have a backup available depending on how you set things up - option to "Overwrite the existing database" and "Restore with Recovery" are selected

(this may be what your [Database manager] button is; however, you do not tell us who your host is so there's no way for us to know what this will do; however, from other hosts, this may be the location where you might find any back-ups and user privilege settings, etc...)

3) There may be some other steps to take, there are a few SQL queries that might be able to pull from your transaction logs; however, if these were overwritten when you created a new database on-top of your old database then I'm fairly certain that recovery is not possible.

I have this in my tool box - found it somewhere ages ago - it worked in my production environment, your mileage may vary:
Expand|Select|Wrap|Line Numbers
  1. select d.name,recovery_model_desc,last_log_backup_lsn from sys.database_recovery_status r join sys.databases d on r.database_id=d.database_id
Looking to see if the recovery mode is "full" and that the last_log_backup_lsn isn't null. If either fail, then Recovery without some other source of data backup is, TTBOMK, not possible.

NB: A bit late; however, it bears repeating:
+ ALWAYS back-up your file(s) before making changes - have the back-up feature enabled.
+ ALWAYS make changes on a working copy NEVER on the production file(s)
+ NEVER overwrite the Production file(s) with the Working files before you have a back-up of the production file(s)
Jul 29 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Dave Moore | last post: by
2 posts views Thread by Thomas Bartkus | last post: by
1 post views Thread by heeheelim lim via .NET 247 | last post: by
reply views Thread by Hans | last post: by
2 posts views Thread by Christoph Krammer | last post: by
4 posts views Thread by Bootstrap Bill | last post: by
5 posts views Thread by Seguros Catatumbo | last post: by
4 posts views Thread by gnawz | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.