How to Use the SQL Connector

How to Use the SQL Connector


Power My Analytics now offers an SQL connector in addition to our Hosted SQL solution. This article will help you get started with using our SQL connector and set up a MSSQL or MySQL query.


Connect to your server in the Hub

Select Sources in the left navigation pane, then click + New Data Source. Click on SQL in the gallery.



Choose MySQL or MSSQL, then enter your Host, Port, Username, Password, and a Name for this server.



Make sure your SQL server is configured to allow connections from PMA's IP address, 35.188.118.242.


Create a query

The connector configuration screen for SQL requires you to enter a query manually.



Format your query according to your database's rules.
A successful query may look like this:

12345
SELECT
*
FROM
table
WHERE DATE BETWEEN
$start$
AND
$end$
limit 100

  1. Use * if you want to retrieve all data from your table. Otherwise, enter the specific terms you wish to select for and make sure the spelling is exactly the same.
  2. Enter the name of the table here and make sure the spelling is exactly the same. Use underline characters (_) instead of spaces.
  3. Date should be formatted according to your database's rules or you can use $start$ to specify your start date within the report.
  4. Date should be formatted according to your database's rules or you can use $end$ to specify your end date within the report.
  5. Set a limit on the number of rows you wish to retrieve. Larger limits will take longer to retrieve. Looker Studio has a limit of 1,000,000. If you do not set a limit and you retrieve more than 1,000,000, you will receive an error.
Click Connect to create your report. If you entered $start$ and $end$ instead of dates, you may specify your range by adding a date range control in Data Studio.




    Still having issues?
    Send us a ticket and we will get back to you.
      • Related Articles

      • How to Export to Azure SQL Database

        Exporting your marketing data to Azure SQL allows you to integrate it with various applications and run complex data queries. This guide will walk you through the process of setting up and managing your Azure SQL exports using Power My Analytics. An ...
      • How to Export to MySQL

        Our MySQL export feature enables flexible access to your data in the form of tables in a MySQL database hosted on the server of your choice. Once you've prepared a report in Data Explorer, you're ready to export your data to your MySQL server. With ...
      • Taboola Data Connector User Guide

        Taboola is a powerful native advertising platform that helps marketers reach their target audience through sponsored content and product recommendations. This guide will walk you through the process of connecting your Taboola account to Power My ...
      • ShipStation Data Connector User Guide

        ShipStation is a powerful e-commerce shipping solution that helps businesses streamline their order fulfillment process. This guide will walk you through how to connect ShipStation to Power My Analytics, create reports, and leverage key metrics to ...
      • Campaign Monitor Data Connector User Guide

        This guide will walk you through the process of setting up and using Campaign Monitor as a data source in Power My Analytics. Campaign Monitor is a powerful email marketing platform, and integrating it with PMA allows you to automate your data ...