Restore single mysql DB

Restore individual mysql db

It is necessary to be very careful when you go to restore individual mysql DB. databases in mysql.

I present a case: you have a db on your personal development, or on your local network and you want to reproduce the production environment that you have online.

Dangerous recovery attention

We run a serious risk: If the backup contained a full dump of the db, done with the Dumping Data in SQL Format with mysqldump, and you do a restore “non-selective”, upon completion you will have restored all the db contained in the backup, including users, passwords and access permissions from various hosts.

Take conscience, could be dangerous.

To restore a single database catalog:
# mysql-u root-p[root_password] [database_name]< dumpfilename.sql

Better yet, open the file in an editor and select, reduce the dump, the only part that you want to restore.

Leave a Reply

Your email address will not be published. Required fields are marked *