9

Easy way to do a mysqldump and restore using netcat (this is NOT encrypted)

 1 year ago
source link: https://gist.github.com/vanjos/6053606
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Easy way to do a mysqldump and restore using netcat (this is NOT encrypted) · GitHub

Instantly share code, notes, and snippets.

Easy way to do a mysqldump and restore using netcat (this is NOT encrypted)

How does encryption work here on the fly...?

With stream cipher encryption enabled...

#!/bin/bash

#####
# On the target machine
nc -l 55555 | openssl enc -d -aes-128-cfb -pass pass:<password> | gzip -d -c | mysql <database name> -u<user> -p<password>

#####
# On the source machine
mysqldump -u<user> -p<password> <database name> | gzip | openssl enc -aes-128-cfb -pass pass:<password> | nc <ip of target server> 55555

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK