以XML格式查看查询结果

通过使用传统—xml 选项调用MySQL命令行客户程序,你可以以XML格式(而不是传统的列表形式)来查看MySQL查询结果。如果你打算将查询输出与其它程序集成在一起,这一技巧非常有用,这里是一个例子:[code]C:\Documents and Settings\YUCHENGHU>mysql --xml
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.0.67-community MySQL Community Edition (GPL)

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> show databases;

<?xml version="1.0"?>



information_schema

test 2 rows in set (0.00 sec)

mysql>
[/code]