Remote MySQL Dump into local DB

#!/bin/bash DB=$1 shift TABLES=$* ssh -C colin@db2 "mysqldump -u root --password='heLL&*()0' --skip-lock-tables $DB $TABLES > /tmp/load.sql && gzip -c /tmp/load.sql" > /tmp/load.sql.gz && gunzip -c /tmp/load.sql.gz | mysql -u root $DB

Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <pre>
  • Lines and paragraphs break automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or class="OPTIONS" [title="the title"].

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.