From the course: Linux System Engineer: Database Servers Using MariaDB

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Restore logical database backups

Restore logical database backups

From the course: Linux System Engineer: Database Servers Using MariaDB

Start my 1-month free trial

Restore logical database backups

- [Instructor] In the last video, we created a couple logical database backup files in our home directory. We can verify their existence by typing in ls space -1 space ~/*.sql. Hit enter. Now let's use these files to restore our database. First let's login to MRBD using the MySQL interactive tool. Type in mysql space -u space root space -p and hit enter, and enter your database password. Let's get a list of databases by typing in show space databases;. We can see our linuxdevs database which we backed up in a previous video. Let's drop this database using the DROP command. Type in drop space database space linuxdevs; and hit enter. And we'll verify with show space databases;. Now that we see it's gone, let's exit and restore the linuxdev database from our backup. Type in exit. Now type in clear to clear your screen. Now we'll use a MySQL command in a non-interactive way to restore the database. Type in mysql space -u space root space -p space < space ~/dbackup - linuxdevs.sql and hit…

Contents