Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Backup and Restore Databases in MySQL

In MySQL server administration, it is important to safeguard your data in case of human error or a system failure. To accomplish this, MySQL provides the ability to create backups of databases and tables. In this lab, you will be tasked with creating backups for individual databases and tables, as well as full backups of the MySQL server. You will also need to demonstrate the ability to restore the MySQL server from a complete backup.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 10, 2025
Duration
45m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create a Partial Backup of the prod Database That Only Includes the products Table

    Run following command as cloud_user to create a backup of just the products table in the prod database:

    # mysqldump -u root -p prod products > prod_products.sql
    
  2. Challenge

    Create Full Backups of the dev and test Databases

    Run following command to create backups of the dev and test databases:

    # mysqldump -u root -p --databases dev test > dev_test.sql
    
  3. Challenge

    Create a Complete Backup of All the Databases on the MySQL Server

    Use the following command to create a full backup of all the databases on the MySQL server:

    # mysqldump -u root -p --all-databases > full_backup.sql
    
  4. Challenge

    Create Delimited-Text Dump Files of the prod Database in the `/var/lib/mysql-files` Directory

    Run the following command to create delimited-text dump files of the prod database in /var/lib/mysql-files (the use of sudo does not require a password in this lab, so the prompt is for the MySQL root user, using the password Linux4me!:

    # sudo mysqldump -u root -p --tab=/var/lib/mysql-files/ prod
    
  5. Challenge

    Perform a Full Restore of the Databases on the MySQL Server by Reloading the msyql_dump.sql Dump File Located in the `/home/cloud_user` Directory

    To perform a full restore of the MySQL server, run the following command from the /home/cloud_user directory:

    # mysql -u root -p < mysql_dump.sql
    
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight