Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exporting mysql into xml

 
bryan lim
Ranch Hand
Posts: 140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i am not sure should i be asking this in this forum.

anyway, I want to export the data from mysql into xml. i am not sure what is the best way to do it? i googled and realised that PHP can do it but i am not good at it.

is there a recommended solution or a java way to do it?

thank you
 
ujjwal soni
Ranch Hand
Posts: 403
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi buddy you can use the following console command


mysqldump --xml --databases your database name -u username -p password >test.xml

after execution the file named test.xml can find on your mysql>bin> diretory ok

"Helping hands are better then praying lips"

<919998971048>

 
Scott Selikoff
author
Saloon Keeper
Posts: 3894
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've seen questions like this, and the simple answer is, you need to write a software program, possibly a short JDBC one, to do it. You can export the data into a flat format like CSV or as a database backup, but if you're looking for a more meaningful XML interpretation, databases simple aren't equipped to handle it. For example, consider normalized data where you might have a country id instead of a country name. Inside of a database, it makes sense to reference a country by a fixed id, but exported to XML you might want to resolve it to a name, or a code for the country. In short, there's nothing simple about building an XML out of a database unless you are using especially flat data.
 
Scott Selikoff
author
Saloon Keeper
Posts: 3894
16
Eclipse IDE Flex Google Web Toolkit
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ytbryan lim"

Please consult the naming policy in regards to your screen names.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic