<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Andrew Mallis&#039; blog &#187; phpMyAdmin</title>
	<atom:link href="http://andrewmallis.com/blog/tag/phpmyadmin/feed" rel="self" type="application/rss+xml" />
	<link>http://andrewmallis.com/blog</link>
	<description>this is the personal blog for Andrew Mallis</description>
	<lastBuildDate>Sat, 19 Nov 2011 09:39:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>how to back up databases using phpMyAdmin</title>
		<link>http://andrewmallis.com/blog/2009/06/02/how-to-back-up-databases-using-phpmyadmin</link>
		<comments>http://andrewmallis.com/blog/2009/06/02/how-to-back-up-databases-using-phpmyadmin#comments</comments>
		<pubDate>Wed, 03 Jun 2009 01:04:30 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[tech tips]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpMyAdmin]]></category>

		<guid isPermaLink="false">http://andrewmallis.com/blog/?p=234</guid>
		<description><![CDATA[Back ups are important. Like brushing your teeth, it&#8217;s something you should do routinely. And, as you&#8217;d brush before important events, like going out on a date, so should you too backup before upgrading software. I&#8217;m going to show you how to use phpMyAdmin to back up and restore MySQL databases. In my next post, [...]]]></description>
			<content:encoded><![CDATA[<p><span id="sample-permalink">Back ups are important. Like brushing your teeth, it&#8217;s something you should do routinely. And, as</span><span id="sample-permalink"> you&#8217;d brush before important events, like going out on a date, so should you too backup before upgrading </span>software.</p>
<p>I&#8217;m going to show you how to use <a href="http://www.phpmyadmin.net" target="_blank" class="liexternal">phpMyAdmin</a> to back up and restore MySQL databases. In my next post, I&#8217;ll show you how to graduate to doing the same thing using the command line.</p>
<p>I use <a href="http://www.mamp.info/" target="_blank" class="liexternal">MAMP</a> to develop websites locally. I&#8217;ve written about this before <a href="http://andrewmallis.com/blog/2007/11/03/mamp-and-xamp" class="liinternal">here</a>. The examples I&#8217;ll be showing come from the phpMyAdmin packaged with MAMP, but apply just as well to any other environment.<span id="more-234"></span></p>
<h2>phpMyAdmin without the MAMP frame</h2>
<p style="text-align: left;">First things first. Let&#8217;s  work so we can see what we&#8217;re doing.I&#8217;m going to assume that you&#8217;re able to download and install MAMP or MAMP Pro on your own. The phpMyAdmin URL that you from the MAMP default webstart page gets you to the URL:</p>
<p style="text-align: left;"><a href="http://localhost/MAMP/frame.php?src=%2FphpMyAdmin%2F%3Flang%3Den-iso-8859-1&amp;language=English" target="_blank" class="liexternal">http://localhost/MAMP/frame.php?src=%2FphpMyAdmin%2F%3Flang%3Den-iso-8859-1&amp;language=English</a></p>
<p>which looks gives you a framed version of the phpMyAdmin. The framing takes up a lot of screen real estate.</p>
<p style="text-align: center;"><a href="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_noframe-250x201.png" class="liimagelink"><img class="size-full wp-image-239 aligncenter" title="phpmyadmin_mampframe" src="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_mampframe-250x201.png" alt="phpMyAdmin widow with the MAMP framing" width="250" height="201" /></a></p>
<p>Instead, use <a href="http://localhost/phpMyAdmin" target="_blank" class="liexternal">http://localhost/phpMyAdmin</a> and you&#8217;ll get something that looks much more pleasing:</p>
<p style="text-align: center;"><a href="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_noframe-250x201.png" class="liimagelink"><img class="size-full wp-image-238 aligncenter" title="phpmyadmin_noframe" src="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_noframe-250x201.png" alt="phpMyAdmin window without a frame" width="250" height="201" /></a></p>
<h2>dumping a database with phpMyAdmin</h2>
<p>Select a database from the drop-down menu on the left hand side of phpMyAdmin. Or, Navigate to &#8220;home&#8221; by clicking the little house under the phpMyAdmin logo in the top left and hit the blue Databases link in the  longish list there.<a href="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_home.png" class="liinternal"></a></p>
<p style="text-align: center;"><a href="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_home.png" class="liimagelink"><img class="size-full wp-image-245 aligncenter" title="phpmyadmin_home" src="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_home-250x182.png" alt="phpmyadmin_home" width="250" height="182" /></a></p>
<p>Ok, so now we see the tables in our database. Press the Export tab at the top. We&#8217;re going to export this database.</p>
<p style="text-align: center;"><a href="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_table-250x214.png" class="liimagelink"><img class="aligncenter size-full wp-image-253" title="phpmyadmin_table" src="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin_table-250x214.png" alt="phpmyadmin_table" width="250" height="214" /></a></p>
<p>Let&#8217;s review the options you should select to get nice, compact, and legible SQL.</p>
<p style="text-align: center;"><a href="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin2102_exportdb3-600x632.png" class="liimagelink"><img class="aligncenter size-full wp-image-252" title="phpmyadmin2102_exportdb3" src="http://andrewmallis.com/blog/wp-content/uploads/2009/06/phpmyadmin2102_exportdb3-600x632.png" alt="phpmyadmin2102_exportdb3" width="600" height="632" /></a></p>
<p>The first column, in the Export fieldset, is pretty straight forward. By default all the tables in your database will be selected. SQL is the format you want too.</p>
<p>&#8220;Disable foreign key checks&#8221; isn&#8217;t always necessary. I do a lot of CiviCRM work. Restoring a CiviCRM database will fail unless this option is enabled in your export.</p>
<p>&#8220;Add DROP TABLE / DROP VIEW&#8221; will delete your table on import before recreating it.</p>
<p>Extended inserts and Complete insterts gives you a smaller file and more compacted, easy to read view.</p>
<p>Click &#8220;Save as file&#8221; and use &#8220;gzipped&#8221; compression for the smallest files.</p>
<p>In the File name template, I add %D, which spits out today&#8217;s date. I add a little hypen before to seperate it from the database name and MAMP after, so I know it was a local dump and not from my live server. This format would give me a file like: mysql-06_02_09_MAMP.sql.gz</p>
<p>To restore your databse, click on the import tab, click the browse button, select your file, press go. I&#8217;ll spare you the screenshot.</p>
<div id="bppostbookmarks"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fandrewmallis.com%2Fblog%2F2009%2F06%2F02%2Fhow-to-back-up-databases-using-phpmyadmin&t=how+to+back+up+databases+using+phpMyAdmin" target="_blank" class="liimagelink"><img src="http://andrewmallis.com/blog/wp-content/plugins/bp-bookmarks/images/yahoo-icon.png" alt="Add to Yahoo" title="Add to Yahoo" /></a> <a href="http://www.google.com/bookmarks/mark?op=add&bkmk=http%3A%2F%2Fandrewmallis.com%2Fblog%2F2009%2F06%2F02%2Fhow-to-back-up-databases-using-phpmyadmin&title=how+to+back+up+databases+using+phpMyAdmin" target="_blank" class="liimagelink"><img src="http://andrewmallis.com/blog/wp-content/plugins/bp-bookmarks/images/g-icon.png" alt="Add to Google" title="Add to Google" /></a> <a href="http://del.icio.us/post?&url=http%3A%2F%2Fandrewmallis.com%2Fblog%2F2009%2F06%2F02%2Fhow-to-back-up-databases-using-phpmyadmin&title=how+to+back+up+databases+using+phpMyAdmin" target="_blank" class="liimagelink"><img src="http://andrewmallis.com/blog/wp-content/plugins/bp-bookmarks/images/delicious-icon.png" alt="Save to Del.icio.us" title="Save to Del.icio.us" /></a> <a href="http://digg.com/submit?phase=2&url=http%3A%2F%2Fandrewmallis.com%2Fblog%2F2009%2F06%2F02%2Fhow-to-back-up-databases-using-phpmyadmin&title=how+to+back+up+databases+using+phpMyAdmin&bodytext=&topic=" target="_blank" class="liimagelink"><img src="http://andrewmallis.com/blog/wp-content/plugins/bp-bookmarks/images/digg-icon.png" alt="Digg IT!" title="Digg IT!" /></a> <a href="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=http%3A%2F%2Fandrewmallis.com%2Fblog%2F2009%2F06%2F02%2Fhow-to-back-up-databases-using-phpmyadmin&title=how+to+back+up+databases+using+phpMyAdmin&top=1" target="_blank" class="liimagelink"><img src="http://andrewmallis.com/blog/wp-content/plugins/bp-bookmarks/images/live-icon.gif" alt="Live Bookmarks!" title="Live Bookmarks!" /></a> </div>]]></content:encoded>
			<wfw:commentRss>http://andrewmallis.com/blog/2009/06/02/how-to-back-up-databases-using-phpmyadmin/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

