Sunday, March 09, 2014

Table Backup in MySQL

Here's what I believe is the most efficient way to backup a table:
Through Navicat, open a console window on the server/database you are backing up to.
Then do this:
mysql>; create table backup.errorCdrs_20140309 like clover.errorCdrs;
Query OK, 0 rows affected
mysql> insert into backup.errorCdrs_20140309 select * from clover.errorCdrs;
Query OK, 5260808 rows affected
Records: 5260808  Duplicates: 0  Warnings: 0

I don't have a timing to support my claim that this is the most efficient, but I think it is because it is done at the server, so the traffic should be within the server. You could just go to the file system and make a copy the table files and maybe that would be more efficient, but I think it is better to work within the MySQL system.

No comments: