How to Backup a MySQL Database - Linux Guru

 

MySQL is the most popular open-source and widely used relational database management system, MySQL is a free and open-source database service. In this post, I will explain to you how to backup and restore MySQL database.

How to backup MySQL database

Run the below command to dump the MySQL database

mysqldump -u [username] -p [password] [database_name] > [backup_file.sql]

This command will create a backup for the database and save it to the backup_file.sql


How to restore MySQL database

Apply below command to restore a database using backup file.
mysql -u [username] -p [password] [database_name] < [backup_file.sql]

This command will import the backup in the database using backup file.


Hope you like the article, Like share, and comment on the post if you have any suggestions. Click here to know about how to create mysql database, user and permissions.

Vishal Vyas [Linux Guru]

Welcome to Linux Guru! Hello, friends. My name is Vishal Vyas, and I am a DevOps engineer with expertise in Linux and Cloud Computing. I am also a Certified Kubernetes Administrator with over 12 years of experience in the IT field, working with various technologies. Through this blog, I aim to share my technical knowledge on Linux, AWS, DevOps, and web technologies. I will be posting about what I have learned from the latest web technologies and similar topics.

7 Comments

If you have any doubts, Please let me know

  1. Thanks for the auspicious writeup. It if truth be told was
    a leisure account it. Look complex to more delivered agreeable from you!
    By the way, how could we communicate?

    Stop by my blog: bug spray

    ReplyDelete
  2. Hi there everybody, here every one is sharing such familiarity, thus it's pleasant to read this webpage, and I used to pay a visit
    this weblog every day.

    my site: garnicia cambogia

    ReplyDelete
  3. Great post. I was checking continuously this blog and
    I'm impressed! Very helpful info specially the last part :) I care
    for such information a lot. I was seeking this particular info for a
    very long time. Thank you and good luck.

    Feel free to visit my weblog ... garcinia cambogia cleanse

    ReplyDelete
  4. Hey there fantastic website! Does running a blog like this take a large amount of work?

    I have very little knowledge of programming but I was
    hoping to start my own blog in the near future. Anyway, if you have any ideas or tips for new
    blog owners please share. I understand this is off topic but I
    just had to ask. Thanks!

    Feel free to visit my page: garcinia cambogia max

    ReplyDelete
  5. Peculiar article, just what I wanted to find.

    Also visit my webpage :: cambogia garcinia

    ReplyDelete
  6. Hey very nice blog!

    Feel free to surf to my web-site: Dragon City Gold Hack

    ReplyDelete
  7. Online backup service is the real answer to all of their concerns regarding data storage and recovery because they are more likely to face data corruption or loss than big businesses.
    goodcloudstorage

    ReplyDelete
Previous Post Next Post