<?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>Pario TechnoBlob &#187; mysqldump</title>
	<atom:link href="http://pario.no/tag/mysqldump/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Thu, 26 Apr 2012 08:18:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Backup mysql databases into separate files</title>
		<link>http://pario.no/2007/11/18/backup-mysql-databases-into-separate-files/</link>
		<comments>http://pario.no/2007/11/18/backup-mysql-databases-into-separate-files/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 21:07:39 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://pario.no/2007/11/18/backup-mysql-databases-into-separate-files/</guid>
		<description><![CDATA[This bach script makes separate backup files of all the databases in mysql and saves the result in the mysql_backup folder. #!/bin/bash -v USERNAME='yourusername' PASSWORD='yourpassword' HOSTNAME='yourhostname' BackupFolder='/backup' for i in $(echo 'SHOW DATABASES;' &#124; mysql --user $USERNAME -p$PASSWORD -h $HOSTNAME &#124; grep -v '^Database$' ); do mysqldump --user $USERNAME -p$PASSWORD -h $HOSTNAME --opt $i > [...]]]></description>
			<content:encoded><![CDATA[<p>This bach script makes separate backup files of all the databases in mysql and saves the result in the mysql_backup folder.</p>
<pre>#!/bin/bash -v

USERNAME='yourusername'
PASSWORD='yourpassword'
HOSTNAME='yourhostname'
BackupFolder='/backup'

for i in $(echo 'SHOW DATABASES;' | mysql --user $USERNAME -p$PASSWORD -h $HOSTNAME | grep -v '^Database$' ); do
        mysqldump --user $USERNAME -p$PASSWORD -h $HOSTNAME --opt $i > $BackupFolder/$i.sql;
done;</pre>
<p>Remember to change the -h, -p and -h switch according to your needs and avoid space between -p and the password variable.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMTEvMTgvYmFja3VwLW15c3FsLWRhdGFiYXNlcy1pbnRvLXNlcGFyYXRlLWZpbGVzLzx3cHRiPkJhY2t1cCBteXNxbCBkYXRhYmFzZXMgaW50byBzZXBhcmF0ZSBmaWxlczx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/11/18/backup-mysql-databases-into-separate-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to backup MySql database</title>
		<link>http://pario.no/2007/09/08/script-to-backup-mysql-database/</link>
		<comments>http://pario.no/2007/09/08/script-to-backup-mysql-database/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 00:35:27 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/09/08/script-to-backup-mysql-database/</guid>
		<description><![CDATA[#!/bin/bash # Shell script to backup MySql database # To backup Nysql databases file to /backup dir and later pick up by your # script. You can skip few databases from backup too. MyUSER="SET-MYSQL-USER-NAME" # USERNAME MyPASS="SET-PASSWORD" # PASSWORD MyHOST="localhost" # Hostname # Linux bin paths, change this if it can't be autodetected via which [...]]]></description>
			<content:encoded><![CDATA[<pre>
#!/bin/bash
# Shell script to backup MySql database
# To backup Nysql databases file to /backup dir and later pick up by your
# script. You can skip few databases from backup too.

MyUSER="SET-MYSQL-USER-NAME"     # USERNAME
MyPASS="SET-PASSWORD"       # PASSWORD
MyHOST="localhost"          # Hostname

# Linux bin paths, change this if it can't be autodetected via which command
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
CHOWN="$(which chown)"
CHMOD="$(which chmod)"
GZIP="$(which gzip)"

# Backup Dest directory, change this if you have someother location
DEST="/backup"

# Main directory where backup will be stored
MBD="$DEST/mysql"

# Get hostname
HOST="$(hostname)"

# Get data in dd-mm-yyyy format
NOW="$(date +"%d-%m-%Y")"

# File to store current backup file
FILE=""
# Store list of databases
DBS=""

# DO NOT BACKUP these databases
IGGY="test"

[ ! -d $MBD ] &amp;&amp; mkdir -p $MBD || :

# Only root can access it!
$CHOWN 0.0 -R $DEST
$CHMOD 0600 $DEST

# Get all database list first
DBS="$($MYSQL -u $MyUSER -h $MyHOST -p$MyPASS -Bse 'show databases')"

for db in $DBS
do
    skipdb=-1
    if [ "$IGGY" != "" ];
    then
	for i in $IGGY
	do
	    [ "$db" == "$i" ] &amp;&amp; skipdb=1 || :
	done
    fi

    if [ "$skipdb" == "-1" ] ; then
	FILE="$MBD/$db.$HOST.$NOW.gz"
	# do all inone job in pipe,
	# connect to mysql using mysqldump for select mysql database
	# and pipe it out to gz file in backup dir :)
        $MYSQLDUMP -u $MyUSER -h $MyHOST -p$MyPASS $db | $GZIP -9 &gt; $FILE
    fi
done</pre>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDkvMDgvc2NyaXB0LXRvLWJhY2t1cC1teXNxbC1kYXRhYmFzZS88d3B0Yj5TY3JpcHQgdG8gYmFja3VwIE15U3FsIGRhdGFiYXNlPHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/09/08/script-to-backup-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell script to backup mySQL database</title>
		<link>http://pario.no/2007/06/04/shell-script-to-backup-mysql-database/</link>
		<comments>http://pario.no/2007/06/04/shell-script-to-backup-mysql-database/#comments</comments>
		<pubDate>Mon, 04 Jun 2007 22:41:29 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/06/04/shell-script-to-backup-mysql-database/</guid>
		<description><![CDATA[Shell script to backup MySql database mysql-backup.bash #!/bin/bash # Shell script to backup MySql database # To backup Nysql databases file to /backup dir and later pick up by your # script. You can skip few databases from backup too. # For more info please see (Installation info): # http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/01/mysql-backup-script.html # Last updated: Aug - [...]]]></description>
			<content:encoded><![CDATA[<p>Shell script to backup MySql database</p>
<p><strong>mysql-backup.bash </strong></p>
<pre>
#!/bin/bash
# Shell script to backup MySql database
# To backup Nysql databases file to /backup dir and later pick up by your
# script. You can skip few databases from backup too.
# For more info please see (Installation info):
# http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/01/mysql-backup-script.html
# Last updated: Aug - 2005
# --------------------------------------------------------------------
# This is a free shell script under GNU GPL version 2.0 or above
# Copyright (C) 2004, 2005 nixCraft project
# Feedback/comment/suggestions : http://cyberciti.biz/fb/
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------

MyUSER="SET-MYSQL-USER-NAME"     # USERNAME
MyPASS="SET-PASSWORD"       # PASSWORD
MyHOST="localhost"          # Hostname

# Linux bin paths, change this if it can't be autodetected via which command
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
CHOWN="$(which chown)"
CHMOD="$(which chmod)"
GZIP="$(which gzip)"

# Backup Dest directory, change this if you have someother location
DEST="/backup"

# Main directory where backup will be stored
MBD="$DEST/mysql"

# Get hostname
HOST="$(hostname)"

# Get data in dd-mm-yyyy format
NOW="$(date +"%d-%m-%Y")"

# File to store current backup file
FILE=""
# Store list of databases
DBS=""

# DO NOT BACKUP these databases
IGGY="test"

[ ! -d $MBD ] &amp;&amp; mkdir -p $MBD || :

# Only root can access it!
$CHOWN 0.0 -R $DEST
$CHMOD 0600 $DEST

# Get all database list first
DBS="$($MYSQL -u $MyUSER -h $MyHOST -p$MyPASS -Bse 'show databases')"

for db in $DBS
do
    skipdb=-1
    if [ "$IGGY" != "" ];
    then
	for i in $IGGY
	do
	    [ "$db" == "$i" ] &amp;&amp; skipdb=1 || :
	done
    fi

    if [ "$skipdb" == "-1" ] ; then
	FILE="$MBD/$db.$HOST.$NOW.gz"
	# do all inone job in pipe,
	# connect to mysql using mysqldump for select mysql database
	# and pipe it out to gz file in backup dir :)
        $MYSQLDUMP -u $MyUSER -h $MyHOST -p$MyPASS $db | $GZIP -9 &gt; $FILE
    fi
done</pre>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDYvMDQvc2hlbGwtc2NyaXB0LXRvLWJhY2t1cC1teXNxbC1kYXRhYmFzZS88d3B0Yj5TaGVsbCBzY3JpcHQgdG8gYmFja3VwIG15U1FMIGRhdGFiYXNlPHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/06/04/shell-script-to-backup-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Export mysql data to a tab-separated file</title>
		<link>http://pario.no/2007/05/07/export-mysql-data-to-a-tab-separated-file/</link>
		<comments>http://pario.no/2007/05/07/export-mysql-data-to-a-tab-separated-file/#comments</comments>
		<pubDate>Mon, 07 May 2007 10:56:29 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/05/07/export-mysql-data-to-a-tab-separated-file/</guid>
		<description><![CDATA[# mysqldump -u root -p --no-create-info -T=/tmp --fields-terminated-by='\t' db tabell]]></description>
			<content:encoded><![CDATA[<pre>
# mysqldump -u root -p --no-create-info -T=/tmp --fields-terminated-by='\t' db tabell</pre>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDUvMDcvZXhwb3J0LW15c3FsLWRhdGEtdG8tYS10YWItc2VwYXJhdGVkLWZpbGUvPHdwdGI%2BRXhwb3J0IG15c3FsIGRhdGEgdG8gYSB0YWItc2VwYXJhdGVkIGZpbGU8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/05/07/export-mysql-data-to-a-tab-separated-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copying One mySQL database from one machine to another</title>
		<link>http://pario.no/2007/05/07/copying-one-mysql-database-from-one-machine-to-another/</link>
		<comments>http://pario.no/2007/05/07/copying-one-mysql-database-from-one-machine-to-another/#comments</comments>
		<pubDate>Mon, 07 May 2007 10:55:55 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://hhj.no/wordpress/2007/05/07/copying-one-mysql-database-from-one-machine-to-another/</guid>
		<description><![CDATA[# mysqldump -h host.com -u root -p password sourceDB &#124; mysql -h host2.com -u username -p password -C targetDB Interestingly, you don&#8217;t actually have be on the &#8216;source&#8217; machine thanks to mySQL&#8217;s -h switch. From the target machine, simply specify the remote host after the -h. This was quite useful for me as my source [...]]]></description>
			<content:encoded><![CDATA[<pre>
# mysqldump -h host.com  -u root -p password sourceDB | mysql -h host2.com -u username -p password -C targetDB</pre>
<p>Interestingly, you don&#8217;t actually have be on the &#8216;source&#8217; machine thanks to mySQL&#8217;s -h switch. From the target machine, simply specify the remote host after the -h. This was quite useful for me as my source machine didn&#8217;t have mysqldump installed.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMDUvMDcvY29weWluZy1vbmUtbXlzcWwtZGF0YWJhc2UtZnJvbS1vbmUtbWFjaGluZS10by1hbm90aGVyLzx3cHRiPkNvcHlpbmcgT25lIG15U1FMIGRhdGFiYXNlIGZyb20gb25lIG1hY2hpbmUgdG8gYW5vdGhlcjx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/05/07/copying-one-mysql-database-from-one-machine-to-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

