X hits on this document

415 views

0 shares

1 downloads

0 comments

99 / 142

XML and MySQL

To explore this database and MySQL's ability to export XML, you need to create the database and fill it with content. Again, change directories to the root of the workshop's distribution and run these MySQL commands:

  • 1.

    mysqladmin -u root create waters

  • 2.

    mysql -u root waters < sql/water-collection/water-collection.sql

Next, use your favorite text editor to open and read the various .sql files in the sql/water-collection dir- ectory. The statements in these files are a bit more complicated than the previous examples. This is be- cause of the relational nature of the database.

Finally, use the mysql client with the --xml option to query the waters database and print XML reports. It is easier if you change directories the water-collection directory first and then:

  • mysql --xml -u root waters < get-collectors-01.sql

  • mysql --xml -u root waters < get-collectors-02.sql

  • mysql --xml -u root waters < get-collectors-03.sql

  • mysql --xml -u root waters < get-collectors-04.sql

  • mysql --xml -u root waters < get-waters-01.sql

  • mysql --xml -u root waters < get-waters-02.sql

91

Document info
Document views415
Page views421
Page last viewedTue Dec 06 14:14:48 UTC 2016
Pages142
Paragraphs3126
Words34660

Comments