Copying a MySQL database FAST

Ryan Byrd ryanbyrd at gmail.com
Wed Aug 6 10:04:27 MDT 2008


> Can you do this across databases? I don't think you can.
Using INSERT INTO ... SELECT you can copy data from one database to
another. You need the correct privileges for both.

Enter the source database, database1:
use database1;

Then write to which fields in the destination database you want to
copy to, database2:
INSERT INTO database2.table1 (field1,field3,field9)
SELECT table2.field3,table2.field1,table2.field4
FROM table2;

src: http://dev.mysql.com/doc/refman/5.0/en/insert-select.html



More information about the PLUG mailing list