?
Solved

Copy MySql database from one linux server to another over SSH

Posted on 2006-11-27
6
Medium Priority
?
964 Views
Last Modified: 2008-01-09
I am trying to setup a simple backup script for my production database so when I run it it will copy copy the data from the production linux machine to my local linux development box. I have MySql 4.0 running on both linux boxes. They will need to communicate through SSH. I want this to be as automated as possible so I can setup a cron job for it later.

Any ideas?
0
Comment
Question by:Isisagate
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 30

Accepted Solution

by:
todd_farmer earned 2000 total points
ID: 18019970
Take a look at http://sourceforge.net/projects/automysqlbackup/ - I use this to backup my production box.  It's easy to configure using crontab.
0
 
LVL 11

Author Comment

by:Isisagate
ID: 18020286
Does it have the ability to restore the database backup to a remote server to?
0
 
LVL 30

Expert Comment

by:todd_farmer
ID: 18020326
Not directly, but it's easy to include that in a shell script.  Just configure automysqlbackup on your local machine to connect to the remote machine and generate the SQL dump file locally, then execute:

mysql --user=user_name --password=pass db_name < /path/to/backup.sql
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 30

Expert Comment

by:todd_farmer
ID: 18023866
You can do it in one command, as well:

mysqldump --host=[remote host] --user=[remote user] --password=[remote password] -C db_name | mysql --host=localhost --user=[local user] --password=[local password] db_name


0
 
LVL 11

Author Comment

by:Isisagate
ID: 18072179
Awesome Good Tool Suggestion!
0
 
LVL 30

Expert Comment

by:todd_farmer
ID: 18074577
Glad it works for you - thanks for the points!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question