I have a vps with ubuntu 9 server.
I need to backup my MySql database.
Can MySql make backups automatically? If so, how?
If not, how should I do it then?
The website is a classifieds website (PHP, MySql etc)
Thanks
I have a vps with ubuntu 9 server.
I need to backup my MySql database.
Can MySql make backups automatically? If so, how?
If not, how should I do it then?
The website is a classifieds website (PHP, MySql etc)
Thanks
Generally you just write a script to it and put make a cron entry for the script so it runs as often as you want. There are a bunch of examples here.
Database Backup Crash Course for a Programmer:
Bad:
outfile = ''
i = 0
while backup:
version = i % 7;
//In this case, the dump is from from the previous iteration of loop
Tape_Backup(outfile);
DB_Dump(outfile=strcat('dump.' + version + '.tar.gz'));
Sleep(1 day);
Good:
outfile = ''
i = 0
while backup:
version = i % 7;
DB_Dump(outfile=strcat('dump.' + version + '.tar.gz'));
Tape_Backup(outfile);
Sleep(1 day);
You make database backups of MySQL databases by using the mysqldump command. You would simply create a cron entry that would execute the mysqldump command.