Skip to content

Instantly share code, notes, and snippets.

@dbolser
Created November 18, 2013 15:45
Show Gist options
  • Save dbolser/7529989 to your computer and use it in GitHub Desktop.
Save dbolser/7529989 to your computer and use it in GitHub Desktop.
SERVER1=mysql-devel-2
SERVER2=mysql-staging-1-ensrw
A="SELECT xref.* "
B="SELECT object_xref.* "
C="SELECT ontology_xref.* "
BASE="
FROM
ontology_xref
INNER JOIN
object_xref USING (object_xref_id)
INNER JOIN
xref USING (xref_id)
WHERE ## GO GO GO!
external_db_id = 1000
"
while read -r db; do
echo $db
$SERVER1 ${db} -e "${A}${BASE}" > A.file && $SERVER2 ${db} -e 'LOAD DATA LOCAL INFILE "A.file" INTO TABLE xref'
$SERVER1 ${db} -e "${B}${BASE}" > B.file && $SERVER2 ${db} -e 'LOAD DATA LOCAL INFILE "B.file" INTO TABLE object_xref'
$SERVER1 ${db} -e "${C}${BASE}" > C.file && $SERVER2 ${db} -e 'LOAD DATA LOCAL INFILE "C.file" INTO TABLE ontology_xref'
echo; echo
done \
< <( grep _core_ plant_21_db.list )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment