views:

102

answers:

4

How can you convert a MySQL database to XML? I want everythimg... data and there relation in XML schema file

how to convert from sqlyog community 8.13(free version)

+5  A: 

phpMyAdmin has an Export to XML function in it. You could either use that, or examine the code to see how they did it.

nickf
+5  A: 
mysqldump --xml test > test.xml

or

mysqldump -X test > test.xml

mysqldump to xml

Svetlozar Angelov
A: 

SQLyog also does a good implementation of exporting data to XML...

Rippo
HOe..i cant see any tab or option in sqkypg...
Right click on table and select "Backup/Export" and choose "Export table data as..."You can choose CSV, HTML, XML, Excel XML or SQL...Very handy
Rippo
A: 

The command line client that comes with MySQL has a --xml option: http://dev.mysql.com/doc/refman/5.1/en/mysql-command-options.html#option%5Fmysql%5Fxml

If the output format of that does not match what you need, you could just select the data out and concatenate it with your xml tags:

select concat('<field1>',field1,'</field1><field2>',field2,
'</field2>') from table
Alterlife