To get a MySQL command line:
mysql --user=your-user-name --host=your-database-name.db
And yes you can automatically back up you MySQL database, by yourself, for free. There are just a couple hoops to jump through.
First set up SSH passwordless authentication as described here, with the modification that you cannot install the public key yourself on the NearlyFreeSpeech.net end. You must send them a "Support Request" (click on the Support tab after logging in) with the public key, and they will register it within a few hours.
Their FAQ kind of tip toes around the issue without giving a clear answer: . The member wiki has the real solution. Create a /home/private/.my.cnf file in your nearlyfreespeech.net account:
host = put_your_DSN_here
user = put_your_username_here
password = put_your_password_here
Then on the machine where you want to store the database backup (your desktop?) execute the following:
ssh email@example.com 'mysqldump thedatabase | bzip2 -9' > ~/backups/thedatabase_backup-`date +%Y-%m-%d`.sql.bz2
Note that "mysqldump" is found in the "mysql-client" package, at least in Debian. And of course, to automate, stick the above in your crontab ("crontab -e").
(Note: replace "user" below with your nearlyfreespeech.net username.)
Just in case anyone else has the bright idea of trying to use their existing BackupPC backup server to backup websites on nearlyfreespeech.net, let me save you some time: it will not work.
nearlyfreespeech.net assigns different IP addresses to different web services. So you can ping your web host, for example, at xxxx.nfshost.com, but the SSH server you connect to in order to gain SSH access to your hosting directory is on a different IP at ssh.phx.nearlyfreespeech.net. If you try to ping ssh.phx.nearlyfreespeech.net you will get no response.
For better or worse, BackupPC insists on a backup client being pingable before it will attempt a backup.
If anyone has a bright idea, I am all ears....
In the meantime, rdiff-backup works nicely.
I have been hosting several websites with nearlyfreespeech.net for over a year now, and believe I have found the perfect host for small sites. They may in fact be perfect for large sites as well, but I don't personally have one to try them on with.
Basically they provide a great service at an incredibly cheap price. The cheap price comes from the fact that you pay as you go for both disk storage (US$0.01 / MB / day) and bandwidth (sliding scale starting at $1/G), ie. the bigger the site, or the busier the site, the larger the monthly bill will be. For a small static site without a lot of activity, you could easily pay as little as ten cents per month for hosting. I have several small modestly active sites, including this blog and:
One of the sites uses MySQL, which I believe costs one cent per day. Combined, all of my sites have been costing me about one dollar per month to keep running.
Using Paypal, you can add as little as US$0.25 to your account at a time (they take a service charge, I think six cents). You may reduce the percentage of the service charge by increasing the size of the deposit, ie. there is a thirty cent service charge for a US$5 deposit.
Servers are FreeBSD, and you get full Unix shell account access with your account. Any time I have reached for a standard UNIX utility, it has been there: Midnight Commander, Unison, and nano come to mind. In addition to FTP, there is also SSH access to the account.
The only thing I have wanted and found them lacking was the Apache modpython module. That may be a FreeBSD limitation, I don't know.
The service and website have been so flawless that I literally have not once felt the need to try to contact support.