Scenario:
You are working as MySQL or MariaDB Admin 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?
Solution:
To take full backup of a database in MySQL or MairaDB , below mysqldump command can be used.
shell > mysqldump --user=YourUserName --password=PasswordfortheUser DatabaseName >/DestinationDirectory/BackupFileName.sql
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
Video Demo : How to restore Database in MariaDB
Liên hệ Aivivu, đặt vé máy bay tham khảo
ReplyDeletevé máy bay đi Mỹ giá rẻ 2021
vé máy bay hà nội sài gòn ngày mai
vé máy bay sg đi hà nội
vé máy bay đi đà lạt bao nhiêu tiền
giá vé máy bay vietjet đi quy nhơn
xe đưa đón sân bay
combo đà lạt 4 ngày 3 đêm