← Back to Upcase

Copying one table in a DB to another DB in a different server


(Javier Carballo) #1

Hello!

I am trying to copy one table of a database, to another database in another server. The databases are identical, but I need only the data from one table.

I tried using mysqldump but it overrides the rest of the database.

Thanks in advance!


(Pedro Moreira) #2

Hello, have you tried Taps (https://github.com/ricardochimal/taps) ?


(Daniel Collis-Puro) #3

@javiercarballo - you can definitely dump only a single table via mysqldump, something like:

mysqldump -h databasehostname -u user -p databasename tablename

You might want --add-drop-tables if you’re replacing the table entirely on the new server, but be sure to check out the dump contents (they are fairly easy to understand) to ensure it’s not doing anything incorrect.