How to Use the MySQL command line to export data in XML format

Source: Internet
Author: User
Tags mysql command line

The following describes how to use MySQL command lines to export data in XML format using MySQL command lines. If you are interested in MySQL command lines, take a look.

Use the "-X" option.

 
 
  1. # mysql -X -u root -e "use mysql; select * from user;" 

The output result is as follows:

 
 
  1. <?xml version="1.0"?> 
  2.    
  3. <resultset statement="select * from user"> 
  4.   <row> 
  5.         <field name="Host">localhost</field> 
  6.         <field name="User">root</field> 
  7.         <field name="Password"></field> 
  8.         <field name="Select_priv">Y</field> 
  9.         <field name="Insert_priv">Y</field> 
  10.         <field name="Update_priv">Y</field> 
  11.         <field name="Delete_priv">Y</field> 
  12.         <field name="Create_priv">Y</field> 
  13.         <field name="Drop_priv">Y</field> 
  14.         <field name="Reload_priv">Y</field> 
  15.         <field name="Shutdown_priv">Y</field> 
  16.         <field name="Process_priv">Y</field> 
  17.         <field name="File_priv">Y</field> 
  18.         <field name="Grant_priv">Y</field> 
  19.         <field name="References_priv">Y</field> 
  20.         <field name="Index_priv">Y</field> 
  21.         <field name="Alter_priv">Y</field> 
  22.         <field name="Show_db_priv">Y</field> 
  23.         <field name="Super_priv">Y</field> 
  24.         <field name="Create_tmp_table_priv">Y</field> 
  25.         <field name="Lock_tables_priv">Y</field> 
  26.         <field name="Execute_priv">Y</field> 
  27.         <field name="Repl_slave_priv">Y</field> 
  28.         <field name="Repl_client_priv">Y</field> 
  29.         <field name="Create_view_priv">Y</field> 
  30.         <field name="Show_view_priv">Y</field> 
  31.         <field name="Create_routine_priv">Y</field> 
  32.         <field name="Alter_routine_priv">Y</field> 
  33.         <field name="Create_user_priv">Y</field> 
  34.         <field name="ssl_type"></field> 
  35.         <field name="ssl_cipher"></field> 
  36.         <field name="x509_issuer"></field> 
  37.         <field name="x509_subject"></field> 
  38.         <field name="max_questions">0</field> 
  39.         <field name="max_updates">0</field> 
  40.         <field name="max_connections">0</field> 
  41.         <field name="max_user_connections">0</field> 
  42.   </row> 
  43. </resultset> 

The preceding section describes how to use MySQL command lines to export data in XML format.

Solution to querying garbled characters in MySQL

How to delete duplicate records in MySQL

Use MySQL temporary tables to accelerate queries

How to properly use MySQL Indexes

Automatic Restoration of MySQL Log Files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.