News: We have a frontpage
Moderator: MaxCoderz Staff
- benryves
- Maxcoderz Staff
- Posts: 3088
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
Do you back up the database (I mean you, personally, not your host)?
It's fairly trivial to do; if you have MySQL installed locally, you can do this:
mysqldump -uusername -ppassword -hhost databasename > backup.sql
Restoring it is simple:
mysql -uusername -ppassword -hhost databasename < backup.sql
You can write a basic batch script (.cmd file) that uses the time as the filename, and then add that batch script as a scheduled task to automatically run on an hourly/daily/weekly backup.
It's fairly trivial to do; if you have MySQL installed locally, you can do this:
mysqldump -uusername -ppassword -hhost databasename > backup.sql
Restoring it is simple:
mysql -uusername -ppassword -hhost databasename < backup.sql
You can write a basic batch script (.cmd file) that uses the time as the filename, and then add that batch script as a scheduled task to automatically run on an hourly/daily/weekly backup.
-
- Calc Master
- Posts: 1110
- Joined: Mon 20 Dec, 2004 10:01 pm
- Location: In the state of Roo Fearing
- Contact:
Any sane webhost wouldn't allow remote MySQL access...benryves wrote:Do you back up the database (I mean you, personally, not your host)?
It's fairly trivial to do; if you have MySQL installed locally, you can do this:
mysqldump -uusername -ppassword -hhost databasename > backup.sql
Restoring it is simple:
mysql -uusername -ppassword -hhost databasename < backup.sql
You can write a basic batch script (.cmd file) that uses the time as the filename, and then add that batch script as a scheduled task to automatically run on an hourly/daily/weekly backup.