Run mySQLdump and output to SSH

[email protected]:~# ssh-keygen -t rsa -b 2048

2. Copy new key pair to target server.

The long and short of this little trick is that you have to use ssh-keygen to create new authentication key pairs for. we'll use these for automating login.

3. Dump the database.

Using mysqldump and gzip it's time to dump the database to a compressed archive on the target host.

[email protected]:~# mysqldump -u[dbuser] -p[dbpass] -h [dbhost] [dbname] | gzip -c | ssh [email protected] 'cat > /pathtodumps/dump.sql.gz'

© Jason White 2019 | Privacy Policy | CV | Life Hacks

made with