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

Ejmplos:
mi usuario mysql:root
mi clave:root
tablaname:producto
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:

PRODUCT
-----------
colum1
colum2
colum3

Hacemos un siemple query:

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

Saludos


6 comentarios:

Anónimo dijo...

like gambling? ardour las vegas? entirely inactive at liberty the all reborn [url=http://www.casinolasvegass.com]casino[/url] las vegas at www.casinolasvegass.com with utility of 75 in unsupported [url=http://www.casinolasvegass.com]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=http://www.place-a-bet.net/]casino[/url] www.place-a-bet.net! few more free casino games and free [url=http://www.2010-world-cup.info]casino bonus[/url] you can find at the 2 new [url=http://www.buy-cheap-computers.info]casino[/url] guides : www.2010-world-cup.info and www.buy-cheap-computers.info .

Anónimo dijo...

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

Anónimo dijo...

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

Anónimo dijo...

Hello. Facebook takes a [url=http://www.realcazinoz.com]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=http://www.filmkpktut.ru/]кино[/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

Followers

 

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