1

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?

1
  • 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.CommentedNov 30, 2011 at 19:01

3 Answers 3

3

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 
    1

    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.

    1
    • 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.CommentedNov 30, 2011 at 19:04
    0

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

    2
    • What others have you considered? Why do you think this is the best? OPs parameters might be quite different than yours...
      – vonbrand
      CommentedMar 21, 2013 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
      CommentedMar 21, 2013 at 21:23

    You must log in to answer this question.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.