<docbook><section><title>VirtMySQLLinkingObjects</title><bridgehead class="http://www.w3.org/1999/xhtml:h3">Linking Tables from MySQL into Virtuoso</bridgehead>
<para>1.
 Start the Virtuoso Web User Interface.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtWebHome.png" /></figure></para><para>2.
 Select the <emphasis>Conductor</emphasis> link in the left frame and login as the <emphasis>dba</emphasis> user.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtConductor.png" /></figure></para><para>3.
 Select the <emphasis>Databases</emphasis> -&gt; <emphasis>External Data Source</emphasis> -&gt; <emphasis>Data Sources</emphasis> tab menu items.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS0.png" /></figure></para><para>4.
 Select the <emphasis>Connect</emphasis> button for the <emphasis>mysqlma</emphasis> MySQL DSN.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS1.png" /></figure></para><para>5.
 On succesful connection, select the <emphasis>Link Objects</emphasis> button to obtain a list of available tables.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS2.png" /></figure></para><para>6.
 Select all the tables that are part of the <emphasis>mysql</emphasis> catalog.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS3.png" /></figure></para><para>7.
 Ensure a primary key is assigned to all tables that are to be used in the EDM generation phase.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS4.png" /></figure></para><para>8.
 Change the Catalog for each table to be <emphasis>mysql</emphasis> using the <emphasis>Set All</emphasis> button. 9.
 Select the <emphasis>Link</emphasis> button to link the selected tables into Virtuoso.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS5.png" /></figure></para><para>10.
 On completion of the Link process, the tables will be displayed in the <emphasis>External Linked Objects</emphasis> tab.<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS6.png" /></figure></para>
<para>11.
 The linked tables can be queried by clicking on the hyperlink in the <emphasis>Local Name</emphasis> column of the <emphasis>External Linked Objects</emphasis> tab above.
 This loads the Virtuoso <emphasis>Interactive SQL</emphasis> interface with the required SQL <emphasis>Select</emphasis> for retrieving the remote table data.
 We shall use the <emphasis>mysql.mysqlma.artist</emphasis> table to demonstrate this.<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS9.png" /></figure></para>
<para>12.
 Click the <emphasis>Execute</emphasis> button to run the query and retrieve the results from the remote table.<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS10.png" /></figure></para>
<para>13.
 The tables can also be viewed as part of the Virtuoso <emphasis>SQL Schema Objects</emphasis> under the <emphasis>mysql</emphasis> catalog name.
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS7.png" /></figure> . . .
<figure><graphic fileref="VirtMySQLLinkingObjects/VirtLinkMYS8.png" /></figure></para><para>The link process is now complete enabling the tables to be queried as if part of the Virtuoso Schema.
</para></section></docbook>