Get XML Output from MySQL

MySQL can product XML output. Just instruct MySQL to return data as XML instead of sql.

Here is how to get XML output from MySQL:

/opt/lampp/bin/mysql -uroot -proot --xml -e "select post_title, post_date,guid, post_content from wt.wp_posts limit 50" > /tmp/posts.xml

Options:

--xml: for xml output

--execute or -e: for executing output.

Can use multiple query inside "". Separate each query with semicolon.

Comments are open for an year period. Please, write here on Facebook page.