<?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>Netflow Developments &#187; .sql</title>
	<atom:link href="http://blog.netflowdevelopments.com/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.netflowdevelopments.com</link>
	<description>The latest and greatest happenings in the world of Science, Technology and everything else Geek</description>
	<lastBuildDate>Mon, 06 Feb 2012 02:48:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Backup all mysql databases to individual files</title>
		<link>http://blog.netflowdevelopments.com/2011/02/16/backup-mysql-individual-files/</link>
		<comments>http://blog.netflowdevelopments.com/2011/02/16/backup-mysql-individual-files/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 16:34:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.sql]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[individual files]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">http://blog.netflowdevelopments.com/?p=593</guid>
		<description><![CDATA[Thanks go out to Sonia Hamilton, as her blog is where I found the original version of this script, however it did need a fair bit of tweaking to work properly in BSD so I went ahead and redid parts of it  as you can see below. This script will back up each of your [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks go out to<a href="http://soniahamilton.wordpress.com/2005/11/16/backup-multiple-databases-into-separate-files/"> Sonia Hamilton</a>, as her blog is where I found the original version of this script, however it did need a fair bit of tweaking to work properly in BSD so I went ahead and redid parts of it  as you can see below.</p>
<p>This script will back up each of your databases separates into their handy dandy own .sql files and then gzip them up for you.  Enjoy</p>
<blockquote><p>#!/bin/bash<br />
# sonia 16-nov-05 &amp; Ryan 16-feb-11<br />
# backup each mysql db into a different file, rather than one big file<br />
# as with &#8211;all-databases &#8211; will make restores easier</p>
<p>USER=&#8221;"<br />
PASSWORD=&#8221;"<br />
OUTPUTDIR=&#8221;/usr/mysqlbackup&#8221;<br />
MYSQLDUMP=&#8221;/usr/local/bin/mysqldump&#8221;<br />
MYSQL=&#8221;/usr/bin/mysql&#8221;</p>
<p>#Clean out yesterdays news<br />
rm -rf $OUTPUTDIR/*</p>
<p>#Get a list of databases<br />
databases=$(/usr/local/bin/mysql -u$USER -p$PASSWORD -e &#8220;SHOW DATABASES;&#8221; | grep<br />
-Ev &#8220;(Database|information_schema)&#8221;)</p>
<p>#Dump each database in turn<br />
for db in $databases; do<br />
echo &#8220;Now Dumping $db&#8221;<br />
$MYSQLDUMP -f -u$USER -p$PASSWORD $db | gzip &gt; $OUTPUTDIR/$db.gz<br />
done</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.netflowdevelopments.com/2011/02/16/backup-mysql-individual-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing / Loading a Mysql backup / database from a .sql file &#8211; In Shell</title>
		<link>http://blog.netflowdevelopments.com/2009/03/23/importing-loading-a-mysql-backup-database-from-a-sql-file-in-shell/</link>
		<comments>http://blog.netflowdevelopments.com/2009/03/23/importing-loading-a-mysql-backup-database-from-a-sql-file-in-shell/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 22:26:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.sql]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[import .sql]]></category>
		<category><![CDATA[Linux / Freebsd]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">http://blog.netflowdevelopments.com/2009/03/23/importing-loading-a-mysql-backup-database-from-a-sql-file-in-shell/</guid>
		<description><![CDATA[I was appalled when the first page of search results for this came up with instructions on how to do this for a Windows server.  So I felt it my duty to add to the tutorials out there for people actually running a real web server (BSD/Linux/Etc) Parse in the .sql file into an already [...]]]></description>
			<content:encoded><![CDATA[<p>I was appalled when the first page of search results for this came up with instructions on how to do this for a Windows server.  So I felt it my duty to add to the tutorials out there for people actually running a real web server (BSD/Linux/Etc)</p>
<p>Parse in the .sql file into an already existing DB</p>
<p>In shell simply issue the following command</p>
<p>$ mysql -u root -p db-name &lt; backup-file.sql</p>
<p>To create a new DB and then import</p>
<p>Login to Mysql:<br />
<code>$ mysql -u root -p</code></p>
<p>Now create database called sales using SQL statement:</p>
<pre>mysql&gt; <strong>CREATE DATABASE <span style="color: #ff0000;">myDB</span>;</strong>
mysql&gt; <strong>quit</strong>;</pre>
<p>Now restore database, enter:<br />
<code>$ mysql -u root -p myDB &lt; <span style="color: #993399;">/path/to/your-DB-file.sql</span></code><br />
Easy Peasy isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netflowdevelopments.com/2009/03/23/importing-loading-a-mysql-backup-database-from-a-sql-file-in-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

