MySQL DBA Tutorial - How to Restore Database from backup in MySQL Server


You are working as MySQL DBA and you have taken the full backup of a database by using mysqldump utility, Now you need to restore that backup to database, how would you do that?


To take full backup of a database in MySQL  , below mysqldump command can be used.
shell > mysqldump --user=YourUserName --password=PasswordfortheUser DatabaseName >/DestinationDirectory/BackupFileName.sql
Let's say if you have a database name testdb and you would like to take full backup, you can use below command

shell > mysqldump --user=root --password=DBA123 testdb >/mysqlbackup/testdb.sql

To Restore, you will be using below command. Make sure you have created empty database first , otherwise you will get an error.

shell > mysql --user=UserName --password=PasswordforUser DatabaseName < /SourceDirectoryforBackup/BackupFile.sql
Let's say if we would like to restore testdb, I can use below statement.
shell > mysql --user=root --password=DBA123 testdb < /mysqlbackup/testdb.sql

MySQL DBA Tutorial - Restore Database from mysqldump file


  1. Can you please share the video how to do the point in time recovery in mysql 8.0.16 in linux

  2. There’s never been a better time to sell online. Find out how our solutions can help your business save time, save on sending1 and deliver a winning customer experience fulfilment services uk.To process orders faster, keep packaging handy and ready to send.Visit this for tools, solutions and support to help make your small business shine.