[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Copy MySql database from one linux server to another over SSH

Posted on 2006-11-27
6
Medium Priority
?
975 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
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

649 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