Copying a MySQL database FAST

Dave Smith dave at thesmithfam.org
Wed Aug 6 09:58:56 MDT 2008


Matthew Frederico wrote:
> # /etc/init.d/mysql stop
> # cd /var/lib/mysql (or wherever your mysql data files are located)
> # cp -a database_x database_y
> # /etc/init.d/mysql start
>
> And voila, you have an exact copy of your database and it's pretty fast.
>   

No, you have a corrupt database. Remember, these are InnoDB tables. You 
can't just do the copy like that unless you have ISAM or MyISAM tables.

--Dave




More information about the PLUG mailing list