Query Azure Database for MySQL - Flexible Server from Azure Data Explorer

Published Jan 20 2022 02:15 PM 1,078 Views
Microsoft

Azure Data Explorer is a fully managed, high-performance, big data analytics platform that makes it easy to analyze high volumes of data in near real time. The Azure Data Explorer toolbox gives you an end-to-end solution for data ingestion, query, visualization, and management. Azure Data Explorer is scalable, secure, robust, and enterprise-ready, and is useful for log analytics, time series analytics, IoT, and general-purpose exploratory analytics.

 

The mysql_request plugin in Azure Data Explorer sends query to a Azure Database for MySQL - Flexible Server network endpoint and returns the first row set in the results. The query may return more than one row set, but only the first row set is made available for the rest of the Kusto query.

 

This post walks you through the process of connecting to and querying an Azure Database for MySQL flexible server from Azure Data Explorer.

 

Prerequisites

Before you begin to work through the process outlined in this post, be sure to create an:

Connect to the cluster and database in Azure Data Explorer  

To connect to the cluster and database in Azure Data Explorer, perform the following steps:

 

1. Open a browser, navigate to https://dataexplorer.azure.com, and then select Add Cluster:

 

Add_Cluster.png

 

2. In the Add Cluster dialog box, specify a connection URI and display name, and then select Add.

 

Add_Cluster_1.png

 

After you’ve connected to the cluster, you’ll see the database that’s part of the cluster.

 

3. Select the database to set the scope.

 

Add_Cluster_2.png

 

Enable the mysql_request plugin

The mysql_request plugin is in preview mode and is disabled by default.

Note: To verify which plugins are enabled, run the .show plugins management command.

 

The mysql_request plugin makes callouts to the MySQL database, so you need to ensure that the cluster's callout policy enables calls of type mysql to the target MySqlDbUri.

  • To set the callout policy, run the following command:

 

.alter cluster policy callout @'[{"CalloutType": "mysql", "CalloutUriRegex": "\\.mysql\\.database\\.azure\\.com", "CanCall": true}]' 

 

 

Note: The command above includes an alter callout policy command for mysql CalloutType. It's recommended that you restrict the callout policy to specific endpoints, for example: "CalloutUriRegex": "my_endpoint1\\.mysql\\.database\\.azure\\.com",

 

Connect to the Azure Database for MySQL flexible server

When you connect to the Azure Database for MySQL flexible server, the firewall verifies that Azure connections are allowed. To enable this setting, in the portal, on the Networking tab, select the Allow public access from Azure services and resources within Azure to this server option, and then select Save. For more information, see Connect from Azure.

 

Important: Be sure to obfuscate any confidential or guarded information from connection strings and queries to ensure that it is omitted from any Kusto tracing. For more information, see Obfuscated string literals.

 

To connect to the Azure Database for MySQL flexible server, modify the parameters in the following command, and then run the command:

 

 

evaluate mysql_request(
  'Server=<servername>; Port = 3306;'
    'Database=<databasename>;'
    h'UID=<username>;'
    h'Pwd=<password>;', 
  '<Query>')

 

 

Parameter

Replace with the…

<servername>

Name of the Azure Database for MySQL flexible server to which you want to connect.

<databasename>

Name of the database to connect to and query.

<username>

Name of the user to connect with to query database.

<Password>

Password to use to connect to database.

<Query>

Query that you want to run against the database.

 

The following example command runs a query to retrieve all table information for a database named mysql, filters the information, and then shows the requested columns.

 

 

evaluate mysql_request(
  'Server=snmyqlflexidemo1.mysql.database.azure.com; Port = 3306;'
    'Database=mysql;'
    h'UID=mysqladmin;'
    h'Pwd=Password;', 
  'SELECT * FROM information_schema.tables;')
  | where TABLE_SCHEMA == 'bidirrepldemo'
  | project TABLE_NAME,TABLE_TYPE,ENGINE

 

 

query_result.png

 

Conclusion

Connecting to different data sources is a requirement when you want to have an end-to-end solution that provides for data ingestion, query, visualization, and management. You can use the mysql_request plugin to connect to the databases hosted on an Azure Database for MySQL flexible server from Azure Data Explorer.

 

If you have any feedback or questions, please leave a comment below or email our team at AskAzureDBforMySQL@service.microsoft.com. Thank you!

%3CLINGO-SUB%20id%3D%22lingo-sub-3066629%22%20slang%3D%22en-US%22%3EQuery%20Azure%20Database%20for%20MySQL%20-%20Flexible%20Server%20from%20Azure%20Data%20Explorer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3066629%22%20slang%3D%22en-US%22%3E%3CP%3EAzure%20Data%20Explorer%20is%20a%20fully%20managed%2C%20high-performance%2C%20big%20data%20analytics%20platform%20that%20makes%20it%20easy%20to%20analyze%20high%20volumes%20of%20data%20in%20near%20real%20time.%20The%20Azure%20Data%20Explorer%20toolbox%20gives%20you%20an%20end-to-end%20solution%20for%20data%20ingestion%2C%20query%2C%20visualization%2C%20and%20management.%20Azure%20Data%20Explorer%20is%20scalable%2C%20secure%2C%20robust%2C%20and%20enterprise-ready%2C%20and%20is%20useful%20for%20log%20analytics%2C%20time%20series%20analytics%2C%20IoT%2C%20and%20general-purpose%20exploratory%20analytics.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fmysqlrequest-plugin%3Fpivots%3Dazuredataexplorer%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Emysql_request%3C%2FA%3E%20plugin%20in%20Azure%20Data%20Explorer%20sends%20query%20to%20a%20Azure%20Database%20for%20MySQL%20-%20Flexible%20Server%20network%20endpoint%20and%20returns%20the%20first%20row%20set%20in%20the%20results.%20The%20query%20may%20return%20more%20than%20one%20row%20set%2C%20but%20only%20the%20first%20row%20set%20is%20made%20available%20for%20the%20rest%20of%20the%20Kusto%20query.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20post%20walks%20you%20through%20the%20process%20of%20connecting%20to%20and%20querying%20an%20Azure%20Database%20for%20MySQL%20flexible%20server%20from%20Azure%20Data%20Explorer.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-2132588895%22%20id%3D%22toc-hId-2135451835%22%3EPrerequisites%3C%2FH1%3E%0A%3CP%3EBefore%20you%20begin%20to%20work%20through%20the%20process%20outlined%20in%20this%20post%2C%20be%20sure%20to%20create%20an%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fmysql%2Fflexible-server%2Fquickstart-create-server-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EInstance%20of%20Azure%20Database%20for%20MySQL%20-%20Flexible%20Server%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fdata-explorer%2Fcreate-cluster-database-portal%3Ftabs%3Done-click-create-database%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Data%20Explorer%20cluster%20and%20database%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH1%20id%3D%22toc-hId-325134432%22%20id%3D%22toc-hId-327997372%22%3E%3CSPAN%20class%3D%22TextRun%20Highlight%20SCXW5922290%20BCX8%22%20data-contrast%3D%22none%22%3E%3CSPAN%20class%3D%22NormalTextRun%20CommentStart%20SCXW5922290%20BCX8%22%20data-ccp-parastyle%3D%22heading%201%22%3EConnect%20to%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW5922290%20BCX8%22%20data-ccp-parastyle%3D%22heading%201%22%3Ethe%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW5922290%20BCX8%22%20data-ccp-parastyle%3D%22heading%201%22%3Ecluster%20and%20database%20in%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW5922290%20BCX8%22%20data-ccp-parastyle%3D%22heading%201%22%3E%20Azure%20Data%20Explorer%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW5922290%20BCX8%22%20data-ccp-parastyle%3D%22heading%201%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22EOP%20SCXW5922290%20BCX8%22%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A240%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH1%3E%0A%3CP%3ETo%20connect%20to%20the%20cluster%20and%20database%20in%20Azure%20Data%20Explorer%2C%20perform%20the%20following%20steps%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Open%20a%20browser%2C%20navigate%20to%20%3CA%20href%3D%22https%3A%2F%2Fdataexplorer.azure.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fdataexplorer.azure.com%3C%2FA%3E%2C%20and%20then%20select%20%3CSTRONG%3EAdd%20Cluster%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Add_Cluster.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F340888i3485CFADBA76DD7C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Add_Cluster.png%22%20alt%3D%22Add_Cluster.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%26nbsp%3BIn%20the%20%3CSTRONG%3EAdd%20Cluster%3C%2FSTRONG%3E%20dialog%20box%2C%20specify%20a%20connection%20URI%20and%20display%20name%2C%20and%20then%20select%20%3CSTRONG%3EAdd%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Add_Cluster_1.png%22%20style%3D%22width%3A%20614px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F340889i5C7CDE6CB76567D2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Add_Cluster_1.png%22%20alt%3D%22Add_Cluster_1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3EAfter%20you%E2%80%99ve%20connected%20to%20the%20cluster%2C%20you%E2%80%99ll%20see%20the%20database%20that%E2%80%99s%20part%20of%20the%20cluster.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%26nbsp%3BSelect%20the%20database%20to%20set%20the%20scope.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22%20padding-left%20%3A%2030px%3B%20%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Add_Cluster_2.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F340890iC56C80044EF89314%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Add_Cluster_2.png%22%20alt%3D%22Add_Cluster_2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--1482320031%22%20id%3D%22toc-hId--1479457091%22%3EEnable%20the%20mysql_request%20plugin%3C%2FH1%3E%0A%3CP%3EThe%20mysql_request%20plugin%20is%20in%20preview%20mode%20and%20is%20disabled%20by%20default.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ETo%20enable%20the%20mysql_request%20plugin%2C%20in%20the%20query%20window%2C%20run%20the%20following%20command%3A%20%3CA%20style%3D%22font-family%3A%20inherit%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fdata-explorer%2Fkusto%2Fmanagement%2Fenable-plugin%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E.enable%20plugin%20mysql_request%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRONG%3ENote%3A%3C%2FSTRONG%3E%20To%20verify%20which%20plugins%20are%20enabled%2C%20run%20the%20%3CA%20style%3D%22font-family%3A%20inherit%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fdata-explorer%2Fkusto%2Fmanagement%2Fshow-plugins%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3E.show%20plugins%3C%2FA%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%20management%20command.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20mysql_request%20plugin%20makes%20callouts%20to%20the%20MySQL%20database%2C%20so%20you%20need%20to%20ensure%20that%20the%20cluster's%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fdata-explorer%2Fkusto%2Fmanagement%2Fcalloutpolicy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecallout%20policy%3C%2FA%3E%20enables%20calls%20of%20type%20mysql%20to%20the%20target%20%3CEM%3EMySqlDbUri%3C%2FEM%3E.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ETo%20set%20the%20callout%20policy%2C%20run%20the%20following%20command%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E.alter%20cluster%20policy%20callout%20%40'%5B%7B%22CalloutType%22%3A%20%22mysql%22%2C%20%22CalloutUriRegex%22%3A%20%22%5C%5C.mysql%5C%5C.database%5C%5C.azure%5C%5C.com%22%2C%20%22CanCall%22%3A%20true%7D%5D'%20%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENote%3A%3C%2FSTRONG%3E%20The%20command%20above%20includes%20an%20alter%20callout%20policy%20command%20for%20mysql%20CalloutType.%20It's%20recommended%20that%20you%20restrict%20the%20callout%20policy%20to%20specific%20endpoints%2C%20for%20example%3A%26nbsp%3B%3CEM%3E%22CalloutUriRegex%22%3A%20%22my_endpoint1%5C%5C.mysql%5C%5C.database%5C%5C.azure%5C%5C.com%22%2C%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1005192802%22%20id%3D%22toc-hId-1008055742%22%3EConnect%20to%20the%20Azure%20Database%20for%20MySQL%20flexible%20server%3C%2FH1%3E%0A%3CP%3EWhen%20you%20connect%20to%20the%20Azure%20Database%20for%20MySQL%20flexible%20server%2C%20the%20firewall%20verifies%20that%20Azure%20connections%20are%20allowed.%20To%20enable%20this%20setting%2C%20in%20the%20portal%2C%20on%20the%20%3CSTRONG%3ENetworking%3C%2FSTRONG%3E%20tab%2C%20select%20the%20%3CSTRONG%3EAllow%20public%20access%20from%20Azure%20services%20and%20resources%20within%20Azure%20to%20this%20server%3C%2FSTRONG%3E%20option%2C%20and%20then%20select%20%3CSTRONG%3ESave%3C%2FSTRONG%3E.%20For%20more%20information%2C%20see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fmysql%2Fflexible-server%2Fhow-to-manage-firewall-portal%23connect-from-azure%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EConnect%20from%20Azure%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EImportant%3C%2FSTRONG%3E%3A%20Be%20sure%20to%20obfuscate%20any%20confidential%20or%20guarded%20information%20from%20connection%20strings%20and%20queries%20to%20ensure%20that%20it%20is%20omitted%20from%20any%20Kusto%20tracing.%20For%20more%20information%2C%20see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fscalar-data-types%2Fstring%23obfuscated-string-literals%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EObfuscated%20string%20literals%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20connect%20to%20the%20Azure%20Database%20for%20MySQL%20flexible%20server%2C%20modify%20the%20parameters%20in%20the%20following%20command%2C%20and%20then%20run%20the%20command%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Eevaluate%20mysql_request(%0A%20%20'Server%3D%3CSERVERNAME%3E%3B%20Port%20%3D%203306%3B'%0A%20%20%20%20'Database%3D%3CDATABASENAME%3E%3B'%0A%20%20%20%20h'UID%3D%3CUSERNAME%3E%3B'%0A%20%20%20%20h'Pwd%3D%3CPASSWORD%3E%3B'%2C%20%0A%20%20'%3CQUERY%3E')%0A%3C%2FQUERY%3E%3C%2FPASSWORD%3E%3C%2FUSERNAME%3E%3C%2FDATABASENAME%3E%3C%2FSERVERNAME%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20style%3D%22border-style%3A%20solid%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22126%22%3E%3CP%3E%3CSTRONG%3EParameter%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22475%22%3E%3CP%3E%3CSTRONG%3EReplace%20with%20the%E2%80%A6%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22126%22%3E%3CP%3E%3CSERVERNAME%3E%3C%2FSERVERNAME%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22475%22%3E%3CP%3EName%20of%20the%20Azure%20Database%20for%20MySQL%20flexible%20server%20to%20which%20you%20want%20to%20connect.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22126%22%3E%3CP%3E%3CDATABASENAME%3E%3C%2FDATABASENAME%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22475%22%3E%3CP%3EName%20of%20the%20database%20to%20connect%20to%20and%20query.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22126%22%3E%3CP%3E%3CUSERNAME%3E%3C%2FUSERNAME%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22475%22%3E%3CP%3EName%20of%20the%20user%20to%20connect%20with%20to%20query%20database.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22126%22%3E%3CP%3E%3CPASSWORD%3E%3C%2FPASSWORD%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22475%22%3E%3CP%3EPassword%20to%20use%20to%20connect%20to%20database.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22126%22%3E%3CP%3E%3CQUERY%3E%3C%2FQUERY%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22475%22%3E%3CP%3EQuery%20that%20you%20want%20to%20run%20against%20the%20database.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20following%20example%20command%20runs%20a%20query%20to%20retrieve%20all%20table%20information%20for%20a%20database%20named%26nbsp%3B%3CSTRONG%3Emysql%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%2C%20filters%20the%20information%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%2C%20and%20then%20shows%20the%20requested%20columns.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Eevaluate%20mysql_request(%0A%20%20'Server%3Dsnmyqlflexidemo1.mysql.database.azure.com%3B%20Port%20%3D%203306%3B'%0A%20%20%20%20'Database%3Dmysql%3B'%0A%20%20%20%20h'UID%3Dmysqladmin%3B'%0A%20%20%20%20h'Pwd%3DPassword%3B'%2C%20%0A%20%20'SELECT%20*%20FROM%20information_schema.tables%3B')%0A%20%20%7C%20where%20TABLE_SCHEMA%20%3D%3D%20'bidirrepldemo'%0A%20%20%7C%20project%20TABLE_NAME%2CTABLE_TYPE%2CENGINE%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22query_result.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F340892i802B7CE411DAA6BC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22query_result.png%22%20alt%3D%22query_result.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--802261661%22%20id%3D%22toc-hId--799398721%22%3EConclusion%3C%2FH1%3E%0A%3CP%3EConnecting%20to%20different%20data%20sources%20is%20a%20requirement%20when%20you%20want%20to%20have%20an%20end-to-end%20solution%20that%20provides%20for%20data%20ingestion%2C%20query%2C%20visualization%2C%20and%20management.%20You%20can%20use%20the%20mysql_request%20plugin%20to%20connect%20to%20the%20databases%20hosted%20on%20an%20Azure%20Database%20for%20MySQL%20flexible%20server%20from%20Azure%20Data%20Explorer.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20any%20feedback%20or%20questions%2C%20please%20leave%20a%20comment%20below%20or%20email%20our%20team%20at%20%3CA%20href%3D%22mailto%3AAskAzureDBforMySQL%40service.microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAskAzureDBforMySQL%40service.microsoft.com%3C%2FA%3E.%20Thank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3066629%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22teaser.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F340886i4C9E83ADEDB1E91A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22teaser.png%22%20alt%3D%22teaser.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20post%20walks%20you%20through%20the%20process%20of%20connecting%20to%20and%20querying%20an%20Azure%20Database%20for%20MySQL%20flexible%20server%20from%20Azure%20Data%20Explorer.%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Co-Authors
Version history
Last update:
‎Jan 20 2022 02:56 PM
Updated by: