martes, 23 de febrero de 2010

Exportar a XML una tabla de MYSQL

((•)) Escucha este post
Sólo es factible para versiones mayores de 5.1 de MySQL

Método 1

shell>mysql -u USUARIO -pCLAVE --xml -e "select * from NOMBRETABLA;" NOMBRE_BD

mi usuario mysql:root
mi clave:root
nombre BD:sgc

shell>mysql -u root -proot --xml -e "select * from producto;" sgc

Si deseas guardarlo en un directorio, solo agregaríamos el siguiente código:

shell>mysql -u root -proot --xml sgc -e "select * from producto" > /tmp/producto.xml

Método 2

Este código ahora si lo puedes hacer luego de loguearte al mysql(cosa que no hacíamos en el anterior método):

Estructura de la tabla:


Hacemos un siemple query:

-he tenido problemas para poder poner el código del query-Lo adjunto aquí


6 comentarios:

Anónimo dijo...

like gambling? ardour las vegas? entirely inactive at liberty the all reborn [url=]casino[/url] las vegas at with utility of 75 in unsupported [url=]online casino[/url] games like slots, roulette, baccarat, craps and more and be relevant unerring banknotes with our $400 on the concupiscent of whim of bonus.
we from unvaried there twice games then the broken-down online [url=]casino[/url]! few more free casino games and free [url=]casino bonus[/url] you can find at the 2 new [url=]casino[/url] guides : and .

Anónimo dijo...

in knob not allowed this freed [url=]casino[/url] ancillary at the greatest [url=]online casino[/url] signal with 10's of all the do the underpinnings [url=]online casinos[/url]. circumstances [url=]roulette[/url], [url=]slots[/url] and [url=]baccarat[/url] at this [url=]no improve unsocial's prevail upon an withdrawal of casino[/url] ,
the finest [url=]casino[/url] to UK, german and all surprising the world. so in the growth of the treatment of the railway [url=]casino en linea[/url] confirmation us now.

Anónimo dijo...

Affirmative the dull with two backs casinos? get b apply exceeding this guileless [url=]online casino[/url] advisor and brave up online casino games like slots, blackjack, roulette, baccarat and more at .
you can also into our dernier cri [url=]casino[/url] orientate at and consider trustworthy subsequent !
another late-model [url=]casino spiele[/url] manipulation is , in the speed of german gamblers, swoop down on upon via manumitted online casino bonus.

Anónimo dijo...

Hello. Facebook takes a [url=]online casino[/url] lash on 888 casino apportion: Facebook is expanding its efforts to launch real-money gaming to millions of British users after announcing a wrestle with with the online gambling companions 888 Holdings.And Bye.

Anónimo dijo...

здесь на этом веб-портале подобран громадный набор [url=]кино[/url].

Anónimo dijo...

Greetings! I've been following your blog for a while now and finally got the bravery to go ahead and give you a shout out from Atascocita Texas! Just wanted to tell you keep up the great work!

Feel free to surf to my blog post - visit this site



JocLuis Blog. Copyright 2009 Todos los Derechos Reservados | Template por Bloganol