Share on Google+Share on Google+

Mysqldump one table - Taking dump of only one table

Advertisement
Use of mysqldump for taking backup of one table

Use of mysqldump for taking backup of one table

In this section you will see the example of mysqldump function which takes the backup of only one table.

The mysqldump utility provides many options to take the backup of data as per user requirement. You can specify the name of table be backup in while executing the mysqldump utility.

Let's assume we have to take the backup of table1 from the mydatabase, then you can issue the following command on the console:

mysqldump -u -p mydatabase table1 > table1.sql

To restore the backup you can use the following command:

mysql -u -p mydatabase < table1.sql

The mysqldump is very handy tool, it can be easily used to take the backup of only one table from the database.

Advertisements

Posted on: April 8, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.