greenhorntechie
greenhorntechie

Reputation: 386

Query on mysqldump

I am trying to use mysqldump for backing up my database and restoring the same in remote a machine for disaster recovery purposes. As I havent used it before, I am having a basic question regarding the same.

Once I dumped and copied over the file,on the target machine, while importing, will it perform the import such a way that it creates new entities while updating any existing ones and deleting any entities deleted in the dump?

Basically, will it keep the target mysql in sync with the dump i.e. the same as on the source?

Thanks

Upvotes: 0

Views: 71

Answers (1)

Nanne
Nanne

Reputation: 64429

Long story short(ish):
Mysqldump will create an SQL file that, when imported in an empty environment, makes a database that is the same as the one the dump was created from.

So no: it will not "sync" anything (e.g. delete files or update records). You can actually look at the file and you will see statements that first create a database, then create the tables and finally insert your data.

They way it works that you take an empty server, import the database and you have you origional situation back. Nothing less, but definitely nothing more as well.

Upvotes: 1

Related Questions