As a rule, I always drop the database, and then create a new one and only after that restore a dump file. But I'm wondering, is it necessary to do?

For example, if I lose some data and begin to restore my database, why I cannot just to restore it, like in MS SQL, without deleting it first?


Read the first few lines of the dump -- Does it say DROP DATABASE or anything like that?

(There are many options on mysqldump that control whether drops, creates, etc, are emitted into the dump, so there is no single answer to this question.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.