Thursday, May 29, 2008

Backup MySQL Database From Java Part 1

Nothing new with this topic because it has been asked and answered so many times in forums and mailing-lists, but still it's a quite hot topic.

The backup method I'm using in this blog entry is using mysqldump utility that bundled with MySQL download.
Mysqldump has several useful argument that we can make to customize our backup files, such as dumping data, triggers, stored routines in separate files.

For example, backing-up data only should be,
mysqldump --host=myserver --port=3306 --user=william --password=secret --compact --skip-comments --complete-insert --extended-insert --skip-triggers mydata

and backing-up stored routine and triggers should be,
mysqldump --host=myserver --port=3306 --user=william --password=secret --compact --skip-comments --no-create-info --no-data --routines mydata

For complete argument list of mysql dump, click here.

The next step is how to implementing mysqldump in Java

0 comments:

border=0
Free Advertising