How to Backup a MySQL Database – Linux Guru

Spread the love

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.

See also  How to Install and Configure vsftpd on CentOS 7

0 thoughts on “How to Backup a MySQL Database – Linux Guru”

  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

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

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


Leave a Comment