0
0
MySQLquery~5 mins

mysqldump usage - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is mysqldump used for?

mysqldump is a tool to create a backup of MySQL databases by exporting their structure and data into a file.

Click to reveal answer
beginner
How do you dump a single database named shop using mysqldump?

Use the command: mysqldump -u username -p shop > shop_backup.sql. This exports the shop database to a file.

Click to reveal answer
beginner
What does the -u and -p option mean in mysqldump?

-u specifies the MySQL username. -p tells the tool to prompt for the password.

Click to reveal answer
intermediate
How can you dump all databases at once using mysqldump?

Use mysqldump -u username -p --all-databases > all_backup.sql to export every database on the server.

Click to reveal answer
beginner
What is the purpose of redirecting output with > in mysqldump commands?

The > symbol sends the dump output to a file instead of showing it on the screen, saving the backup for later use.

Click to reveal answer
Which command backs up a single database named library?
Amysqldump -u user -p --tables library > backup.sql
Bmysqldump -u user -p library > library_backup.sql
Cmysqldump -u user -p --databases library books > backup.sql
Dmysqldump -u user -p --all-databases > library_backup.sql
What does the --all-databases option do?
ABacks up all databases on the server
BBacks up only the current database
CBacks up only tables with data
DBacks up only the database structure
Why do you use -p with mysqldump?
ATo prompt for the password
BTo specify the port number
CTo print the dump on screen
DTo pause the dump process
What does the symbol > do in mysqldump commands?
ARuns the command in the background
BAppends output to an existing file
CRedirects output to a file
DDeletes the output file
Which of these commands is correct to dump multiple specific databases?
Amysqldump -u user -p --tables db1 db2 > multi_backup.sql
Bmysqldump -u user -p --all-databases db1 db2 > multi_backup.sql
Cmysqldump -u user -p db1 db2 > multi_backup.sql
Dmysqldump -u user -p --databases db1 db2 > multi_backup.sql
Explain how to use mysqldump to back up a single database and save it to a file.
Think about the command structure and how to save output.
You got /5 concepts.
    Describe the difference between dumping a single database and dumping all databases with mysqldump.
    Consider the options and what they export.
    You got /4 concepts.