scp – Copy files to another server in SSH

Say you need to replicate a huge MySQL database to another machine and dumping and import the database might take hours, copy the binary files (/var/lib/mysql/DB_NAME) might be a quicker method. To do that, we can use scp:

s1# scp -P SSH_PORT /var/lib/mysql/DB_NAME/ user@s2:/var/lib/mysql/DB_NAME/

You would also need to chmod (644) & chown (mysql:mysql) the files on the destination server so MySQL server can read them properly.

Comments (0)

› No comments yet.

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Pingbacks (0)

› No pingbacks yet.