Showing results for 
Search instead for 
Did you mean: 

database backup


database backup


I've had a look through the past posts and can't really find anything that answers my questions so I decided to post and ask Smiley

My first question is how big a database are you allowed to have on a broadband premier account? I'm writing an online browser based game and can't find any reference to a maximum size. I uploaded some test data to the database and found it appeared to be full at 8.5MB. I did email f9 but didn't get any response.

My other question is what is the best way to back up the database? I can back it up with phpmyadmin but I can only restore the backups in 2mb files and can't be automated that way. I want to use the crontab but I'm having difficulty getting that to work. I tried it from a cshell to check if it works with mysqldump -u username -p password database > backup.sql
(using the propper username, password and database details) but it comes up asking for another password and won't authenticate. So don't know if it's a security thing or whether I'm just using the wrong method. I've tried using the full paths for the destination path as well but just can't seem to get it right.

I've done plenty of work on pc systems and websites but haven't done anything with shell scripts and could really do with an idiots guide if anybody can point me in the right direction Smiley

Any ideas?

Thanks in advance

database backup

mysqldump --user takealeft -p[password] -h humbug takealeft_f9 >out.sql

Obviously replace your username/database name/database host.
Note to remove the space between -p and your password
so if you had password as ipodsr0ck:

mysqldump --user takealeft -pipodsr0ck -h humbug takealeft_f9 >out.sql

To add it to your cron job, just head go to the documentation on this site about crons.

crontab -e to edit

format is:
mins hrs days etc.
comma is to do it multiple times, so this will run every 5 mins:
15,30,45,0 * * * * mysqldump --user takealeft -pipodsr0ck -h humbug takealeft_f9 >out.sql

Obviously, you'd be better off changing it to (a random minute, a random hour)

17 22 * * * mysqldump --user takealeft -pipodsr0ck -h humbug takealeft_f9 >out.sql
So that way you only lose a days worth of data.

Next thing to do is secure the directory/file that it is creating, because otherwise someone could download your database... which may have username/login info.

database backup

Cool, thanks for the answer. I'll give it a go and see what happens Smiley

I also found out the maximum database is 50MB in case anybody wanted to know

database backup

What's the best way to restore the database? using myphpadmin it will only let you upload files at 2mb a time.

Thanks in advance Smiley
Community Veteran
Posts: 1,136
Thanks: 2
Registered: 30-07-2007

database backup

if you have the dump file you can ftp it to so it is in your cgi webspace, then you can restore it using:
mysql -h humbug --user stephenmp -p<your SQL password> -C --database=stephenmp_f9 < out.sql

That should work, its the method I use when I'm backing up my local database to rumpus.
F9 member since 4 Sep 1999
F9 ADSL customer since 27 Aug 2004
DLM manages your line the same way DRM manages your rights.
Look at all the pretty graphs! (now with uptime logging!)

database backup

ah right, didn't know the command for the command line upload.

Thanks alot, job for tomorrow Smiley

database backup

Basically it allows you do any sql via the unix command line.
The < symbol means redirect the contents of the file into the program.

> means the opposite, i.e. save to a file. redirect the output to a file.