Home: Perl Programming Help: DBI:
Easy backup, and import backup?



skirrow
stranger

Feb 23, 2003, 8:59 AM


Views: 13492
Easy backup, and import backup?

Hi,
Are their any modules or any easy ways of backing up an entire mySQL database? Also, if possible also an easy way to then import the backup?

Is the only way to read all the records from the db out to data files and then import from the data files back to the mySQL db?

Thanks,
- Neil
--
http://www.locked-area.com/
http://www.opencrypt.com/


Paul
Enthusiast

Feb 24, 2003, 6:04 AM


Views: 13488
Re: [skirrow] Easy backup, and import backup?

bash$ mysqldump -u USERNAME -p DATABASE > /path/to/file.txt


skirrow
stranger

Feb 24, 2003, 6:12 AM


Views: 13485
Re: [Paul] Easy backup, and import backup?

Thank you!
What about importing the data back to the mySQL db? Or does that dump the structure info as well so I can just run it to re-create dbs?
- Neil
--
http://www.locked-area.com/
http://www.opencrypt.com/


Paul
Enthusiast

Feb 24, 2003, 6:14 AM


Views: 13484
Re: [skirrow] Easy backup, and import backup?

It dumps the structure. Reimport using:

mysql -u USERNAME -p DATABASE < /path/to/file.txt


skirrow
stranger

Feb 24, 2003, 6:27 AM


Views: 13481
Re: [Paul] Easy backup, and import backup?

Excellent! Thank you so much.
- Neil
--
http://www.locked-area.com/
http://www.opencrypt.com/