This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

populate all data from old database to a new one.  RSS feed

 
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
man mysqldump

http://dev.mysql.com/doc/mysql/en/mysqldump.html
[ April 12, 2005: Message edited by: Ben Souther ]
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!