0

not sure its a stack overflow question

I have a Mac and am hosting a Apache MySQL server on it using MAMP Pro. If I back up my data on the time machine, is MySQL database also backed up or do I have to create mysqldump and backup up as a cron job? In case of a crash do I do a normal restore in case it can be backed up on time machine.

Thanks

Ank
  • 6,040
  • 22
  • 67
  • 100
  • MySql databases are stored in files, so if you really have **all** the data backed up, you should be set. Although the golden rule of doing backups is to **test the backup**. You never know if it was ok, unless you test it. – Tadeck Mar 19 '12 at 22:56
  • MySQL databases are not allays completely stored on the hard disk. For performance reasons many databases need more than just the real data files at the hard disk and databases internally can decide to, or just aren't ready with, storing the data at the disk. – Luc Franken Mar 19 '12 at 23:49

1 Answers1

1

Make a regular dump with MySQL dump or use another specific database back-up tool. A copy of the data folder is not ok.

MySQL dump will really read the data and can be checked. It is not always true that all data is written completely to the data file and lockings give issues.

If you have a specific time of back-up just run a cron before that moment and verify whether it is safe and finished. MySQL will take care of lockings, changes, transactions etc.

Always, read always, verify your back-up with a restore test.

Luc Franken
  • 2,994
  • 1
  • 17
  • 14