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

Comments

Popular posts from this blog

Debugging pfsense firewall rules clearly and easily

Direct ssh to a server via proxy using putty/plink on Windows

telnet vs netcat