Tuesday, September 02, 2008

New Backup/Restore Statement in MySQL 6.0

Finally, what I've been waiting for long time is currently in progress !
New backup and restore syntax is available in MySQL begin from version 6.0.5. (it's still in alpha state at the time I write this post)

This syntax is use just like ordinary DDL/DML SQL syntax, so you wouldn't need to run external application eg. mysqldump anymore. The best of it, is the backup process won't block any client accesses, or vice versa. They can now work concurrently, except for the DDL syntax.

The syntax is so simple:
BACKUP DATABASE [DATABASE] TO [PATH];
RESTORE FROM [PATH];

For example, to backup,
BACKUP DATABASE mycompanydatase TO '/home/staff/backup/backupfile.dat';
to restore,
RESTORE FROM '/home/staff/backup/backupfile.dat';

For more information about new BACKUP/RESTORE syntax in MySQL 6.0, see the documentation.
BACKUP/RESTORE using MySQL < 6.0 still need external tools. See my tutorial about Backup MySQL Data Using Java.

5 comments:

Brendan said...

Hi William,
possibly a silly question but I am having trouble getting this to work I get the following error: "Table 'mysql.online_backup' doesn't exist "

when executing the following from both the query browser and my java code.

Its right it doesn't seem to exist.. but where to from here?

William Anthony said...

What version of MySQL server you have?

zawjane said...

hello
i'm absolutely idiot for the computer programming
hehe

husain said...

First I want to congratulate you for this amazing blog!
We Are Pleased To Announce The Launch Of Movies Gallery 08, Mobile Movies in 3gp format, Reality show, Funny Video, Upcoming Movies 08 Trailer, About Dubai,Real Estate, Tips Of Career And Many More.

To start just go to http://moviesvideo.blogspot.com/

We hope you like it. Please send us any feedback on the movies and help us improve the sites further.

Backup Right said...

This is a great blog. Computer backup can be a pain at time, but there are systems out there that make it easy.

border=0
Free Advertising