aspose file tools*
The moose likes JDBC and the fly likes populate all data from old database to a new one. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "populate all data from old database to a new one." Watch "populate all data from old database to a new one." New topic
Author

populate all data from old database to a new one.

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Hi all,

here is the deal: I have installed a mySql db on my client server. He has asked for some improvments and that required me to add some new tables and columns to existing tables.

Question: is there any way to take all the data in his db and populate it into the new db?

Thanks
peter
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Peter,
I don't know mySQL, but perhaps it has some sort of INSERT...SELECT... statement? Most databases do. Alternatively, most databases have a utility to dump table data to some flat file, and another utility to load data into a table from a flat file. But then again, being mySQL, maybe it doesn't have any of those things. (You get what you pay for! )

Good Luck,
Avi.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

man mysqldump

http://dev.mysql.com/doc/mysql/en/mysqldump.html
[ April 12, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Most databases do. Alternatively, most databases have a utility to dump table data to some flat file, and another utility to load data into a table from a flat file.

right but this produces the create and delete. the only thing i am intreseted is in INSERT

so if i have an old db it will produce insert statments.

any idea what the dump command should be?
 
jQuery in Action, 2nd edition
 
subject: populate all data from old database to a new one.
 
Similar Threads
I have fresh new 80 tables in DB, but with no data. Any utility to populate dummy data in all table
Extract db data into a XML
mysql: how to add tables to existed db
MySql db: how to backup data only and backup tables only
Using Java Objects in AJAX??