{"id":592,"date":"2010-04-23T13:51:15","date_gmt":"2010-04-23T08:21:15","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=592"},"modified":"2016-12-19T15:04:55","modified_gmt":"2016-12-19T09:34:55","slug":"592","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/592\/","title":{"rendered":"Backup &#038; Restore MySql Database Table(s)"},"content":{"rendered":"<p>Hi Friends,<\/p>\n<p>I needed to take the backup and restore the selected table(s) of mysql database. And I found Gaurav Chauhan&#8217;s blog on taking <a title=\"dump\" href=\"http:\/\/www.tothenew.com\/blog\/tag\/mysql\/\">dump<\/a> of the database and to<a title=\"restore\" href=\"http:\/\/www.tothenew.com\/blog\/?p=46\"> restore<\/a> the database. So I tried with the same commands but with table names passed as parameters and that worked.<\/p>\n<blockquote>\n<pre lang=\"groovy\">mysqldump -u root -p my_database Table1 Table2 > \/home\/amit\/tablesDump.sql;<\/pre>\n<\/blockquote>\n<p>And the file the dump of Table1 and Table2 got created at \/home\/amit\/tablesDump.sql.<\/p>\n<p>To restore the table(s) back, we used the following command<\/p>\n<blockquote>\n<pre lang=\"groovy\">mysql -u root -p my_database_2  \/\/First we need to login to mysql\r\n\r\nmysql> source \/home\/amit\/tablesDump.sql;<\/pre>\n<\/blockquote>\n<p>Both tables were created in my_database_2.<\/p>\n<p>Hope this helped.<\/p>\n<p>Cheers!<br \/>\n~~Amit Jain~~<br \/>\namit@intelligrape.com<br \/>\nhttp:\/\/www.tothenew.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi Friends, I needed to take the backup and restore the selected table(s) of mysql database. And I found Gaurav Chauhan&#8217;s blog on taking dump of the database and to restore the database. So I tried with the same commands but with table names passed as parameters and that worked. mysqldump -u root -p my_database [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":3},"categories":[1],"tags":[221,224,76],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/592"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=592"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}