Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

My OS is Ubuntu 10.10. I have several small sites (all on various shared hosts) and I'm thinking that it'd be probably good idea to regularly backup mysql databases from these remote shared hosts. I currently do it manually and it seem to be while not laborious but definitely boring process (phpmyadmin).

How should I go about it (no ssh access available)?

If do it like this:

mysqldump -u root -p[root_password] [database_name] -h mysql_host > dumpfilename.sql

Does that mean that password is being transferred in plain text?

share|improve this question
    
If you are executing mysqldump with -p option from a commandline, then you are making the password visible in the process commandline, which can be viewed by anyone executing the ps command. –  Nikhil Mulley Nov 30 '11 at 19:01

4 Answers 4

up vote 3 down vote accepted

Specifying the password that way is just insecure on your machine. Over the network it's just the same way that MySQL clients connect to your database. As far as I read, the username and password are hashed, so you are not sending your password in plain text.

In your situation I would write a simple wrapper script, something like

for host in host1 host2 host3
    do mysqldump ...
done
share|improve this answer

Check out

http://www.phpmybackuppro.net/

Also consider the incremental backups

http://dev.mysql.com/doc/refman/5.1/en/backup-methods.html

Check out maatkit, which automates most of the stuff.

share|improve this answer
    
I would suggest make the mysql backups locally on that machine and periodically sync them to the internal or main site for compressed backups. Just make sure the dumps are stored in a relatively secured directory with restrictive permissions. It would make things easy as well when you are about to restore the databases on a remote site when needed. –  Nikhil Mulley Nov 30 '11 at 19:04

To make multiple MySQL databases backup you can also use this: here. It creates a file (locally) for each database with the dump, and makes you save a lot of time making just the first configuration. Hope it helps, regards! AN

share|improve this answer
    
The link in this comment is dead. –  Bert Dec 13 '13 at 16:12

backup-manager is the most complete and powerful in my opinion.

share|improve this answer
    
What others have you considered? Why do you think this is the best? OPs parameters might be quite different than yours... –  vonbrand Mar 21 '13 at 20:59
    
It can compress file, automatic and scheduled backup, deleting old saves, splitting backups into smaller part. It ave also incremental feature, launch command before/after backup, FTP/SVN/... sync, burning on CD/DVD, multiple SQL database dump, etc. And all configurations is simple (one file) and well documented.You just pick what feature you want to use. –  GHugo Mar 21 '13 at 21:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.