{"id":45,"date":"2009-04-16T18:27:29","date_gmt":"2009-04-16T12:57:29","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=45"},"modified":"2017-03-31T16:10:19","modified_gmt":"2017-03-31T10:40:19","slug":"dumping-a-mysql-database","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/dumping-a-mysql-database\/","title":{"rendered":"Dumping a Mysql Database"},"content":{"rendered":"<p>In this post i will try to explain how to dump a mysql database so that it can be migrated with same state.In my project i face this situation every week and thanks to dumpfiles that they save lot of time and make the process whole lot easier.<\/p>\n<p><strong>What is a dumpfile ? <\/strong><\/p>\n<p>A dumpfile is a sql script which contains the step by step instruction to generate a database. It contains the steps to create the table structure and also populates the tables with the original values. By steps i mean the plain simple sql queries.<\/p>\n<p>The Mysql command used to\u00a0 dump a database is below:<\/p>\n<pre lang=\"groovy\">gaurav@gaurav:~$ mysqldump -u root -p   &gt;<\/pre>\n<p>e.g. Suppose we have a database named <strong>james<\/strong> and we want to take it&#8217;s dump.<\/p>\n<pre lang=\"groovy\">gaurav@gaurav:~$ mysqldump -u root -p james &gt; ~\/Desktop\/jamesDump.sql\r\nEnter Password: ******<\/pre>\n<p>Now we are back to prompt. We can check the dumpfile by going to the location where it was saved. In the<a href=\"http:\/\/www.tothenew.com\/blog\/?p=46\"> next<\/a> post I will describe how to use a dumpfile to create a new database.<\/p>\n<p>Hope it helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post i will try to explain how to dump a mysql database so that it can be migrated with same state.In my project i face this situation every week and thanks to dumpfiles that they save lot of time and make the process whole lot easier. What is a dumpfile ? A dumpfile [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0},"categories":[1],"tags":[4843,485],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/45"}],"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\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}