Copying specific tables from one database to another
This assumes you are copying tables from one
database on one server to another database on a different server...
% mysqldump -u root -p --opt
original_database_name table1 table2 table3 table4 >
~/tableexport.sql
copy the file from
your one server to the other using
scp
on the destination
server
% mysql -u root -p
destination_database_name <
tableexport.sql
NOTE:
If
the tables are very large, the insert statements will be very long and may be
difficult to edit in the standard text editors you may have, so if you plan to
edit the SQL file by hand before re-importing, I recommend you turn off the
extended insert option that is included in the --opt option. THus the export
line would look like this:
% mysqldump
-u root -p --opt --skip-extended-insert original_database_name table1 table2
table3 table4 > ~/tableexport.sql
Posted: Wednesday - April 20, 2005 at 01:03 PM