Backup and Restore a Single Table in MySQL Database

Hello,

Taking the backup of a single table of a MySQL database and restoring it is possible via command line. You might have done this using phpmyadmin or via other applications, let’s check how this can be done using the command line tool.

I am not writing too much, let’s directly move to the steps:
NOTE: Please take necessary backups before doing the below steps
Backup a single table from MySQL Database:

Run the following command to take table backup:

# mysqldump -u <Username> -p <password> <database-name> <Table-Name> < <File-Name>

Example:

# eg: mysqldump -u root -p ROOTPASS test_db test_db_table > test_db_table.sql

That’s all about taking backup. Now let’s see how to restore it.

Restore the table to MySQL database:

Run the following command to restore the table on your destination database:
# Mysql -u <Username_of_destination_DB> -p <Password_of_destination_DB> <DB_Name> < <Backup_file_name>

Example:
# mysql -u dest_user -pDESTPASS dest_db < test_db_table.sql

That’s all guys, happy linuxing!

4 thoughts on “Backup and Restore a Single Table in MySQL Database

  1. mb2bx

    can i purchase generic clomiphene prices can you get generic clomiphene without a prescription can i buy clomid pill clomid only cycle cost of cheap clomid without insurance how can i get generic clomid without dr prescription can i order cheap clomiphene without a prescription

  2. Inscreva-se na binance

    Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

Leave a Reply

Your email address will not be published.