File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Copy Mysql Database using mysqldump utility Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Copy Mysql Database using mysqldump utility" Watch "Copy Mysql Database using mysqldump utility" New topic
Author

Copy Mysql Database using mysqldump utility

Ramesh kangamuthu
Ranch Hand

Joined: Mar 13, 2007
Posts: 79
Hi all,

I need to copy a part of database with data and another part of a database without data to a new database to my localhost.

for that I tried the 'mysqldump' command as directed by sites, where i got the information. But I did not get the result.

1. Is it possible to write a single 'mysqldump' option to copy some tables with data and some tables without data of a database to
another new database.?

I need it urgently. Can you share your ideas.


Thanks,

Ramesh Kangamuthu

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37958
    
  22
We don't use the word "urgently" here.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

What is the full command line for mysqldump that you have been using?

What do you mean by "another part of a database without data"? Do you mean that you have some tables that have data but you don't want the data, only the table definitions? I do not know of any way to tell mysqldump to not dump the data for specific tables. However, you can edit the resulting dump file to remove the INSERT statements that insert data into those tables.


JBoss In Action
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Hi Ramesh,

Surely you can dump only table definitions with "--no-data" directive. Also you can specify which tables to be dumped after database name separated by white spaces.

Have you checked out mysqldump manual for detailed explanation?

Regards,

Fatih.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Copy Mysql Database using mysqldump utility
 
Similar Threads
MySql db: how to backup data only and backup tables only
should I use transaction for this scenario ?
runtime exec
Backup
How to clone records of one table to another table in runtime?