37.6k views
2 votes
Which of the following will restore a MySQL DB from a .dump file?

A• mysql -u -p < db_backup.dump

D• mysql -u -p < db_backup.dump

B• mysql -u -p < db_backup.dump

B• mysql -u -p > db_backup.dump

1 Answer

0 votes

Final answer:

To restore a MySQL database from a .dump file, use the command 'mysql -u username -p database_name < db_backup.dump', replacing 'username' and 'database_name' accordingly. The '<' symbol is used to redirect the dump file contents to the MySQL command line client.

Step-by-step explanation:

To restore a MySQL database from a .dump file, you generally use the following command syntax:

mysql -u username -p database_name < db_backup.dump

The correct command will prompt you for a password and then restore the database from the specified dump file. The username is your MySQL username, and you replace database_name with the name of the database you wish to restore. Note that the '<' symbol is used to redirect the contents of the db_backup.dump file into the MySQL command line client. On the other hand, the '>' symbol would redirect output to a file, which is not what we want in this case of restoring a database.

User Tahir Raza
by
9.1k points