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

Scenario:


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?


Solution:

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


31 comments:

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

    ReplyDelete
  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.

    ReplyDelete
  3. download game guardian apk from eagleapk. best site that is providing amazing mod apks and games freely on website for everyone.

    ReplyDelete
  4. Febrile seizure in children or febrile convulsion is the most common neurological complication that occurred in late infancy and early childhood! See more!

    ReplyDelete
  5. visit our website to play Slotxo game online. best game in 2021

    ReplyDelete
  6. Can you guys help me out in fixing this ui?

    ReplyDelete
  7. Now coming to the point for eye makeup remover this is the best according to surveyor.

    ReplyDelete
  8. Mothers mainly place an especially lofty value on sons as a result of their relationship with them. It is the utmost desire of every parent to select a sentimental gift for their sons.
    Son day

    ReplyDelete
  9. Here are some suggestions for Automate assignment of production tasks by crop
    Centralize staff communications with notifications and reminders.

    ReplyDelete
  10. Here are some suggestions for horticulture software Automate assignment of production tasks by crop
    Centralize staff communications with notifications and reminders.

    ReplyDelete
  11. The cleaning head comes with LED headlights that will let you see mold residing in the carpet and darker places. Therefore, no corners can stay uncleaned.

    Its ability to deep clean carpets makes it the best HEPA vacuum. It can exceptionally pick finely small particles such as mold, dirt, and debris from various carpeted spaces.
    https://10bestvacuums.com/

    ReplyDelete
  12. Leopard Print Linen cushion Euro size, Super thick leopard print linen with lush thick cotton fringe trim and black velveteen backing.

    ReplyDelete
  13. Master of PC in online every time on this site you can get every paid software in free of cost.

    ReplyDelete
  14. internet download manager kuyhaa now for everyone at the very best package as this package is 100% Free.

    ReplyDelete
  15. Technology news updates from top companies are shared here with full case studies.

    ReplyDelete
  16. Courses are launching everyday and best course in power bi is one having details from basic to advanced.

    ReplyDelete
  17. สมัครแทงบอลดีไหม betting is perhaps the most popular activity of placing a bet on a game and predicting the result. The frequency with which people place sports bets upon varies widely by country, with most bets being put on international soccer. The most popular form of betting is also called a spread bet. The bettor can either win the whole bet amount or just part of it depending on how the game will turn out.

    ReplyDelete
  18. A suitable big exercise mat should provide grip, balance, and comfort. However, certain characteristics may be more important depending on how a person intends to use the mat.

    ReplyDelete
  19. Ottawa insulations Services is an experienced and certified company, specializing in mold inspections and mold removal services in Ottawa.

    ReplyDelete
  20. Play Uk49s Results & lunchtime lottery online - LUNCH 6/49. It is simple — choose your favourite number or set of numbers and add them to your bet.

    ReplyDelete
  21. Remember to choose numbers with better odds. Use our Uk49s Predictions page and other 49s tools provided on this website to increase your chances of winning.

    ReplyDelete
  22. The France Lotto Official includes ten amazing prize categories, and players must match five winning numbers as well as one additional number to win the jackpot, which starts at a minimum of €2 million.

    ReplyDelete
  23. Our experienced, qualified homesweethomesfl are able to assist with all residential sale and purchase transactions. We are different. We don’t deal in bulk conveyancing and we don’t use automated systems to manage your file. Our personal service is delivered by a close-knit team of qualified and experienced solicitors Buying .

    ReplyDelete
  24. If you wish to cook dinner just like the pitmasters you see on TV, otherwise you dream of creating toxic money in a barbecue competitor, you’ve most likely acquired the craving of the best offset smoker. We’ve studied the most effective offset smokers based on every price range and stage of expertise more info.

    ReplyDelete
  25. Child custody in Lahore Pakistan refers to the parents right, to raise and care for, covers the responsibility to take decisions regarding the child.

    ReplyDelete
  26. Have you heard about https://www.clothcleaning.com/? How can a towel and water clean better than a chemical cleaner or even vinegar cleaners I make up myself? Visit us for accurate reviews.

    ReplyDelete
  27. The nickname Rip City is usually used in the context of the city’s NBA team, the Portland Trail Blazers. The term was coined by the team’s play-by-play announcer Bill Schonely during a game against the Los Angeles Lakers on February 18, 1971, the Blazers’ first season https://travelingtotally.com/why-is-portland-called-rip-city/.

    ReplyDelete
  28. 49s is the name of the company that organizes the UK 49s lottery. The 49s office is located in London and is played in UK and in South Africa. The site is being updated continuously with the latest UK49s Teatime Results and check for Today’s Teatime Results above. Check all the Uk49s latest results previous Teatime and Lunchtime Results here. If you are in South Africa, the UK, and anywhere else and you think you need to write to us, you can do this easily on Contact Us page here. We’ll get back to you within 72 hours and feel free to subscribe to 49’ers group through above-right section of our page. Our Policy and Blog included.

    ReplyDelete
  29. We only work with resellers we trust. In fact, all the companies we work with are vetted, which means we only show resellers that will offer you a reliable service, and treat your phone fairly and openly.Yes, you can sell broken or faulty mobile phones through sellup. Lots of recyclers offer money for all kinds of damaged phone models Check Warranty Status for Mobile Phone.

    ReplyDelete
  30. City Imaging and Clinical Labs - Always ahead with Technology? To utilize multi disciplinary methodology with moral practices by a group of exceptionally responsive, mindful and effective experts with a steady spotlight on greatness in conveying best clinical benefits in quiet consideration, consistent up degree of administrations, best and precise revealing and to convey benchmark quality in Diagnostics.For better testing visit labuncle,

    ReplyDelete