Sunday, June 6, 2010

MySQL copy table from one database to another

w/o data:

CREATE TABLE <db2>.<table2> LIKE <db1><table1>

with data:

CREATE TABLE <db2>.<table2> SELECT * FROM <db1><table1>

rename:

RENAME TABLE <table1> TO <table2>

No comments:

Post a Comment