Home >> FAQs/Tutorials >> MySQL Tutorials

MySQL Tutorial - Returning Query Output in XML Format

By: FYIcenter.com

(Continued from previous topic...)

How To Return Query Output in XML Format?

By default, "mysql" returns query output in text table format. If you want to receive query output in XML format, you need to use the "-X" command option. Here is a good tutorial exercise:

>cd \mysql\bin
>mysql -u root -X test

mysql> SELECT * FROM links;
<?xml version="1.0"?>
<resultset statement="SELECT * FROM links">
        <field name="id">1</field>
        <field name="name">dba.fyicenter.com</field>
        <field name="id">10</field>
        <field name="name">dba.fyicenter.com</field>
2 rows in set (0.00 sec)

  1. What Is the Command Line End User Interface - mysql?
  2. What Are the "mysql" Command Line Options?
  3. What Are the "mysql" Command Line Arguments?
  4. How Many SQL DDL Commands Are Supported by "mysql"?
  5. How Many SQL DML Commands Are Supported by "mysql"?
  6. What Are the Non-Standard SQL Commands Supported by "mysql"?
  7. How To Get Help Information from the Server?
  8. How To Run "mysql" Commands from a Batch File?
  9. How To Return Query Output in HTML Format?
  10. How To Return Query Output in XML Format?

MySQL Tutorials:


Other Tutorials/FAQs:


Related Resources:


Selected Jobs: