Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

This script should enable, you to pull data from one (table) of database and dump to tmp folder, and import it to diff database.

#!/bin/bash

echo "Deleting dump from /tmp"
`rm -f /tmp/myDump.csv`

mysql -u tikejhya -pPASSWORD --database mail -h db.ashishnepal.com --port 3306 -ss -e "SELECT * FROM database.tablename WHERE search_string='this';" | sed 's/t/","/g;s/^/"/;s/$/"/;s/n//g' > /tmp/myDump.csv

echo "Data Copied Across"
sleep 10;

echo "Ready to Insert Data"

mysql -u tikejhya -pPASSWORD --database mail -h db.ashishnepal.com --port 3306 <

Tips: (dumping date wise)
# mysql -u tikejhya -pPASSWORD --database mail -h db.ashishnepal.com --port 3306 -ss -e "SELECT * FROM database.tablename WHERE search_string='this' AND event_date > date(now()) - 8;" | sed 's/t/","/g;s/^/"/;s/$/"/;s/n//g' > /tmp/myDump.csv