Friday, 3 May 2013

mysqldump between two servers over ssh


  1. set up ssh keys so server1 user can ssh to a server2
  2. set $HOME/.my.cnf so both users can get into respective mysql cli without passwords
    1. see below for sample file
  3. create the new, empty database on server2, receiving server
  4. from server1
    1. mysqldump mydatabase | ssh server2 mysql mydatabase

# $HOME/.my.cnf
[client]
password=myusersmysqlpassword

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...