Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copy Mysql Database using mysqldump utility

 
Ramesh kangamuthu
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We don't use the word "urgently" here.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic