Backup of MySQL via phpMyAdmin

Published: 2010-02-06 19:51 UTC. Tags: misctools python

My girlfriend runs a blog on a cheap hosting firm that doesn't provide any way of doing proper SQL dumps of the MySQL database used by the blogging software.

There are plugins for Wordpress that can do full backups, but I prefer doing raw SQL dumps + a filesystem backup. That way, you know what you get, you don't have to trust the backup plugin author to do it right.

The hosting firm does provide access to a phpMyAdmin installation which you can use to download SQL dumps. The trick is of course to do this automatically, as good backups need to be unattended.

I wrote a python program that can do this, using what turned out to be an excellent library for programmatic web browsing: mechanize.

The backup script is available in my misctools project on GitHub.

←← previous blog entry next blog entry →→

Comment by Matt

Created Fri, 19 Mar 2010 23:16:14 +0000

How exactly do you run this script?
Do you install python locally and run it from your computer, or must it be installed on the hosts server?

Thanks in advance


Comment by Erik Forsberg

Created Sat, 20 Mar 2010 12:01:26 +0000

It's run from any computer that has Python, it does not need to be installed on the host computer.

Post a comment

Posting of comments have been disabled for now. Too much spam.